Skip to content

Commit

Permalink
transport: fix leaking negotiation tips
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pks-t authored and gitster committed Aug 22, 2024
1 parent 7720460 commit 13b23d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions t/t5510-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 13b23d2

Please sign in to comment.