1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 04:49:43 +01:00

transport: fix leaking negotiation tips

We do not free negotiation tips in the transport's smart options. Fix
this by freeing them on disconnect.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt 2024-08-22 11:18:11 +02:00 committed by Junio C Hamano
parent 7720460ccf
commit 13b23d2da5
2 changed files with 5 additions and 0 deletions

View file

@ -5,6 +5,7 @@ test_description='Per branch config variables affects "git fetch".
'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-bundle.sh

View file

@ -947,6 +947,10 @@ static int disconnect_git(struct transport *transport)
finish_connect(data->conn);
}
if (data->options.negotiation_tips) {
oid_array_clear(data->options.negotiation_tips);
free(data->options.negotiation_tips);
}
list_objects_filter_release(&data->options.filter_options);
oid_array_clear(&data->extra_have);
oid_array_clear(&data->shallow);