Message ID | 89b66411354437a1e3a97751f185889dffb84126.1729502824.git.ps@pks.im (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Memory leak fixes (pt.9) | expand |
On 24/10/21 11:28AM, Patrick Steinhardt wrote: > The server options populated via `OPT_STRING_LIST()` is never cleared, s/is/are/ > 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 <ps@pks.im>
On Mon, Nov 4, 2024, at 23:10, Justin Tobler wrote: > On 24/10/21 11:28AM, Patrick Steinhardt wrote: >> The server options populated via `OPT_STRING_LIST()` is never cleared, > > s/is/are/ I guess “is” was chosen because “the list is”. The [list] populated via `OPT_STRING_LIST()` is never cleared,
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c index f723b3bf3bb..f333821b994 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))
The 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 <ps@pks.im> --- builtin/ls-remote.c | 1 + 1 file changed, 1 insertion(+)