transport-helper: fix leaking import/export marks

Fix leaking import and export marks for transport helpers. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Nov 5, 2024 at 07:17 UTC 1a99173de0618636fdd534f46b866a9bb39e487d
2 files changed +3
t/t5801-remote-helpers.sh
+1
@@ -8,6 +8,7 @@ test_description='Test remote-helper import and export commands'
8 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
9 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10
11 +TEST_PASSES_SANITIZE_LEAK=true
12 . ./test-lib.sh
13 . "$TEST_DIRECTORY"/lib-gpg.sh
14
transport-helper.c
+2
@@ -399,6 +399,8 @@ static int release_helper(struct transport *transport)
399 int res = 0;
400 struct helper_data *data = transport->data;
401 refspec_clear(&data->rs);
402 + free(data->import_marks);
403 + free(data->export_marks);
404 res = disconnect_helper(transport);
405 free(transport->data);
406 return res;