]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/shortlog: fix various trivial memory leaks
authorPatrick Steinhardt <ps@pks.im>
Thu, 1 Aug 2024 10:40:41 +0000 (12:40 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Aug 2024 15:47:37 +0000 (08:47 -0700)
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>
builtin/shortlog.c
t/t4201-shortlog.sh

index 5bde7c68c26aaaef06cd8b06474a4b0d3b600f2b..b529608c9236b7df2dee3dfa50a3337d8a92ca86 100644 (file)
@@ -514,4 +514,5 @@ void shortlog_output(struct shortlog *log)
        string_list_clear(&log->list, 1);
        clear_mailmap(&log->mailmap);
        string_list_clear(&log->format, 0);
+       string_list_clear(&log->trailers, 0);
 }
index f698d0c9ad274137a9aa254c8e89bcece8f4cddd..c20c88572445dcc835218509aa280e66dc5b5cf4 100755 (executable)
@@ -9,6 +9,7 @@ test_description='git shortlog
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup' '