diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-08-22 11:18:11 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-08-22 09:18:06 -0700 |
commit | 13b23d2da552b9476a0025562bc4ab8954d5be45 (patch) | |
tree | d426874570c06eed9b1456b2c171b905bfd92303 | |
parent | 7720460ccf8d5a8fcc5cf37bad97b26d799a5644 (diff) |
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>
-rwxr-xr-x | t/t5510-fetch.sh | 1 | ||||
-rw-r--r-- | transport.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 3b3991ab86..0890b9f61c 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -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 diff --git a/transport.c b/transport.c index da639d3bff..0f20fc56e4 100644 --- a/transport.c +++ b/transport.c @@ -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); |