From: Patrick Steinhardt Date: Thu, 1 Aug 2024 10:40:41 +0000 (+0200) Subject: builtin/shortlog: fix various trivial memory leaks X-Git-Tag: v2.47.0-rc0~153^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=06da42beec11e056f43425b2be623fefc0427670;p=thirdparty%2Fgit.git builtin/shortlog: fix various trivial memory leaks There is a trivial memory leak in git-shortlog(1). Fix it. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- diff --git a/builtin/shortlog.c b/builtin/shortlog.c index 5bde7c68c2..b529608c92 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -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); } diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index f698d0c9ad..c20c885724 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -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' '