mirror of
https://github.com/git/git.git
synced 2024-11-27 03:53:55 +08:00
builtin/fmt-merge-msg: fix leaking buffers
Fix leaking input and output buffers in git-fmt-merge-msg(1). Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ee087c29c8
commit
68bd0a94be
@ -67,6 +67,8 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
|
||||
return ret;
|
||||
write_in_full(STDOUT_FILENO, output.buf, output.len);
|
||||
|
||||
strbuf_release(&input);
|
||||
strbuf_release(&output);
|
||||
free(inpath);
|
||||
return 0;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ test_description='fmt-merge-msg test'
|
||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY/lib-gpg.sh"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user