Skip to content

Commit 13b23d2

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7720460 commit 13b23d2

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

t/t5510-fetch.sh

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test_description='Per branch config variables affects "git fetch".
55
66
'
77

8+
TEST_PASSES_SANITIZE_LEAK=true
89
. ./test-lib.sh
910
. "$TEST_DIRECTORY"/lib-bundle.sh
1011

transport.c

+4
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,10 @@ static int disconnect_git(struct transport *transport)
947947
finish_connect(data->conn);
948948
}
949949

950+
if (data->options.negotiation_tips) {
951+
oid_array_clear(data->options.negotiation_tips);
952+
free(data->options.negotiation_tips);
953+
}
950954
list_objects_filter_release(&data->options.filter_options);
951955
oid_array_clear(&data->extra_have);
952956
oid_array_clear(&data->shallow);

0 commit comments

Comments
 (0)