builtin/shortlog: fix various trivial memory leaks
There is a trivial memory leak in git-shortlog(1). Fix it. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Aug 1, 2024 at 12:40 UTC
06da42beec11e056f43425b2be623fefc0427670
2 files changed
+2
builtin/shortlog.c
+1
@@ -514,4 +514,5 @@ void shortlog_output(struct shortlog *log)
514
string_list_clear(&log->list, 1);
515
clear_mailmap(&log->mailmap);
516
string_list_clear(&log->format, 0);
517
+ string_list_clear(&log->trailers, 0);
518
}
t/t4201-shortlog.sh
+1
@@ -9,6 +9,7 @@ test_description='git shortlog
9
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
10
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
11
12
+TEST_PASSES_SANITIZE_LEAK=true
13
. ./test-lib.sh
14
15
test_expect_success 'setup' '