]> git.ipfire.org Git - thirdparty/git.git/commitdiff
send-pack: clean up extra_have oid array
authorJacob Keller <jacob.keller@gmail.com>
Fri, 27 Jun 2025 22:09:04 +0000 (15:09 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Jun 2025 22:17:57 +0000 (15:17 -0700)
Commit c8009635785e ("fetch-pack, send-pack: clean up shallow oid
array", 2024-09-25) cleaned up the shallow oid array in cmd_send_pack,
but didn't clean up extra_have, which is still leaked at program exit.
I suspect the particular tests in t5539 don't trigger any additions to
the extra_have array, which explains why the tests can pass leak free
despite this gap.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/send-pack.c

index 59b626aae8cd8291104d83b5ec201207c97715e8..b28da7ddd7619e0fb570bf8c7a2b49c129835c38 100644 (file)
@@ -344,6 +344,7 @@ int cmd_send_pack(int argc,
        free_refs(remote_refs);
        free_refs(local_refs);
        refspec_clear(&rs);
+       oid_array_clear(&extra_have);
        oid_array_clear(&shallow);
        clear_cas_option(&cas);
        return ret;