Skip to content

Commit 68bd0a9

Browse files
pks-tgitster
authored andcommitted
builtin/fmt-merge-msg: fix leaking buffers
Fix leaking input and output buffers in git-fmt-merge-msg(1). Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ee087c2 commit 68bd0a9

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

builtin/fmt-merge-msg.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
6767
return ret;
6868
write_in_full(STDOUT_FILENO, output.buf, output.len);
6969

70+
strbuf_release(&input);
71+
strbuf_release(&output);
7072
free(inpath);
7173
return 0;
7274
}

t/t6200-fmt-merge-msg.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ test_description='fmt-merge-msg test'
88
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
99
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1010

11+
TEST_PASSES_SANITIZE_LEAK=true
1112
. ./test-lib.sh
1213
. "$TEST_DIRECTORY/lib-gpg.sh"
1314

0 commit comments

Comments
 (0)