From 5f5dd8e297b59f3f7bf61098e978a91c5581388a Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Tue, 5 Nov 2024 07:16:43 +0100 Subject: [PATCH] builtin/ls-remote: plug leaking server options The list of server options populated via `OPT_STRING_LIST()` is never cleared, causing a memory leak. Plug it. This leak is exposed by t5702, but plugging it alone does not make the whole test suite pass. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- builtin/ls-remote.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c index 423318f87e..42f34e1236 100644 --- a/builtin/ls-remote.c +++ b/builtin/ls-remote.c @@ -166,6 +166,7 @@ int cmd_ls_remote(int argc, status = 0; /* we found something */ } + string_list_clear(&server_options, 0); ref_sorting_release(sorting); ref_array_clear(&ref_array); if (transport_disconnect(transport))