]> Kevux Git Server - rit/commitdiff
transport: fix leaking negotiation tips
authorPatrick Steinhardt <ps@pks.im>
Thu, 22 Aug 2024 09:18:11 +0000 (11:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Aug 2024 16:18:06 +0000 (09:18 -0700)
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>
t/t5510-fetch.sh
transport.c

index 3b3991a..0890b9f 100755 (executable)
@@ -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
 
index da639d3..0f20fc5 100644 (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);