Skip to content

Commit 5f5dd8e

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 34b6ce9 commit 5f5dd8e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/ls-remote.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ int cmd_ls_remote(int argc,
166166
status = 0; /* we found something */
167167
}
168168

169+
string_list_clear(&server_options, 0);
169170
ref_sorting_release(sorting);
170171
ref_array_clear(&ref_array);
171172
if (transport_disconnect(transport))

0 commit comments

Comments
 (0)