aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/send-pack.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2024-09-24 17:52:25 -0400
committerJunio C Hamano <gitster@pobox.com>2024-09-25 10:24:53 -0700
commitc8009635785e656cfed3b814beb4eab9fd16eac3 (patch)
tree4692fe3130b93af421991f3f9548c8091a91230a /builtin/send-pack.c
parent0c23f1a9e40038296e5479bedaf27d93f9fdba6a (diff)
downloadgit-c8009635785e656cfed3b814beb4eab9fd16eac3.tar.gz
fetch-pack, send-pack: clean up shallow oid array
When we call get_remote_heads() for protocol v0, that may populate the "shallow" oid_array, which must be cleaned up to avoid a leak at the program exit. The same problem exists for both fetch-pack and send-pack, but not for the usual transport.c code paths, since we already do this cleanup in disconnect_git(). Fixing this lets us mark t5542 as leak-free for the send-pack side, but fetch-pack will need some more fixes before we can do the same for t5539. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/send-pack.c')
-rw-r--r--builtin/send-pack.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index 81fc96d423..c49fe6c53c 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -343,5 +343,6 @@ int cmd_send_pack(int argc,
free_refs(remote_refs);
free_refs(local_refs);
refspec_clear(&rs);
+ oid_array_clear(&shallow);
return ret;
}