]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/send-pack: fix leaking list of push options
authorPatrick Steinhardt <ps@pks.im>
Mon, 30 Sep 2024 09:14:24 +0000 (11:14 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Sep 2024 18:23:09 +0000 (11:23 -0700)
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>
builtin/send-pack.c
t/t5411-proc-receive-hook.sh
t/t5545-push-options.sh

index 8b1d46e79a8724ac0d33999c184227ad440880a3..59b626aae8cd8291104d83b5ec201207c97715e8 100644 (file)
@@ -340,6 +340,7 @@ int cmd_send_pack(int argc,
                /* stable plumbing output; do not modify or localize */
                fprintf(stderr, "Everything up-to-date\n");
 
+       string_list_clear(&push_options, 0);
        free_refs(remote_refs);
        free_refs(local_refs);
        refspec_clear(&rs);
index 92cf52c6d4a32c401680a068f9d892950e13d99a..13d2d310a9f11e4a54c9484e7d2f78b24ee82cd3 100755 (executable)
@@ -8,6 +8,7 @@ test_description='Test proc-receive hook'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 . "$TEST_DIRECTORY"/t5411/common-functions.sh
index fb13549da7f305b88da0f0bdcf3d791907e96a08..64ce56d3aa8395be41f2e6040b19b42ed38f2da3 100755 (executable)
@@ -8,6 +8,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB=1
 export GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 mk_repo_pair () {