builtin/send-pack: fix leaking list of push options
The list of push options is leaking. Plug the leak. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Sep 30, 2024 at 11:14 UTC
66893a14d0c0d3850227def321312a7290317610
3 files changed
+3
builtin/send-pack.c
+1
@@ -340,6 +340,7 @@ int cmd_send_pack(int argc,
340
/* stable plumbing output; do not modify or localize */
341
fprintf(stderr, "Everything up-to-date\n");
342
343
+ string_list_clear(&push_options, 0);
344
free_refs(remote_refs);
345
free_refs(local_refs);
346
refspec_clear(&rs);
t/t5411-proc-receive-hook.sh
+1
@@ -8,6 +8,7 @@ test_description='Test proc-receive hook'
8
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
9
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10
11
+TEST_PASSES_SANITIZE_LEAK=true
12
. ./test-lib.sh
13
14
. "$TEST_DIRECTORY"/t5411/common-functions.sh
t/t5545-push-options.sh
+1
@@ -8,6 +8,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8
GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB=1
9
export GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB
10
11
+TEST_PASSES_SANITIZE_LEAK=true
12
. ./test-lib.sh
13
14
mk_repo_pair () {