Skip to content

Commit 06da42b

Browse files
pks-tgitster
authored andcommitted
builtin/shortlog: fix various trivial memory leaks
There is a trivial memory leak in git-shortlog(1). Fix it. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 50ef4e0 commit 06da42b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

builtin/shortlog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,4 +514,5 @@ void shortlog_output(struct shortlog *log)
514514
string_list_clear(&log->list, 1);
515515
clear_mailmap(&log->mailmap);
516516
string_list_clear(&log->format, 0);
517+
string_list_clear(&log->trailers, 0);
517518
}

t/t4201-shortlog.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ test_description='git shortlog
99
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
1010
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1111

12+
TEST_PASSES_SANITIZE_LEAK=true
1213
. ./test-lib.sh
1314

1415
test_expect_success 'setup' '

0 commit comments

Comments
 (0)