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: Taylor Blau <me@ttaylorr.com>
This commit is contained in:
Patrick Steinhardt 2024-10-21 11:28:40 +02:00 committed by Taylor Blau
parent 06d658163d
commit 7c6616737d
2 changed files with 3 additions and 0 deletions

View File

@ -8,6 +8,7 @@ test_description='Test remote-helper import and export commands'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-gpg.sh

View File

@ -399,6 +399,8 @@ static int release_helper(struct transport *transport)
int res = 0;
struct helper_data *data = transport->data;
refspec_clear(&data->rs);
free(data->import_marks);
free(data->export_marks);
res = disconnect_helper(transport);
free(transport->data);
return res;