aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/ls-remote.c
diff options
context:
space:
mode:
authorXing Xin <xingxin.xx@bytedance.com>2024-10-08 03:38:19 +0000
committerJunio C Hamano <gitster@pobox.com>2024-10-08 10:22:10 -0700
commit0f490d270aa015f0bcb6a99c666eaa5b83f5d375 (patch)
tree686074db80bc4d3e5859ac8f76fa2cfe4b3cd90d /builtin/ls-remote.c
parent148bc7bf4b482edd7919e3071542abeb5d7ea4af (diff)
downloadgit-0f490d270aa015f0bcb6a99c666eaa5b83f5d375.tar.gz
ls-remote: leakfix for not clearing server_options
Ensure `server_options` is properly cleared using `string_list_clear()` in `builtin/ls-remote.c:cmd_ls_remote`. Although we cannot yet enable `TEST_PASSES_SANITIZE_LEAK=true` for `t/t5702-protocol-v2.sh` due to other existing leaks, this fix ensures that "git-ls-remote" related server options tests pass the sanitize leak check: ... ok 12 - server-options are sent when using ls-remote ok 13 - server-options from configuration are used by ls-remote ... Signed-off-by: Xing Xin <xingxin.xx@bytedance.com> Reviewed-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/ls-remote.c')
-rw-r--r--builtin/ls-remote.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index f723b3bf3b..423318f87e 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -173,5 +173,6 @@ int cmd_ls_remote(int argc,
transport_ls_refs_options_release(&transport_options);
strvec_clear(&pattern);
+ string_list_clear(&server_options, 0);
return status;
}