aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-01 12:40:41 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-01 08:47:37 -0700
commit06da42beec11e056f43425b2be623fefc0427670 (patch)
tree7ec05aa900426b4713ca0ea5d34b3e631eb78ea3
parent50ef4e09c386f46898886b1c3ae8bef5783b4e90 (diff)
downloadgit-06da42beec11e056f43425b2be623fefc0427670.tar.xz
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>
-rw-r--r--builtin/shortlog.c1
-rwxr-xr-xt/t4201-shortlog.sh1
2 files changed, 2 insertions, 0 deletions
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' '