summaryrefslogtreecommitdiff
path: root/builtin/repack.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2023-10-07 17:20:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2023-10-09 17:27:34 (GMT)
commitc1b754d0597be83439ecc8de2a59a90f35cd4040 (patch)
tree33582fcd92cb5745c55304edf4877eaa39dbdb62 /builtin/repack.c
parent3c1e2c2113842b8462803ef8c9aca596eacfd3af (diff)
downloadgit-c1b754d0597be83439ecc8de2a59a90f35cd4040.zip
git-c1b754d0597be83439ecc8de2a59a90f35cd4040.tar.gz
git-c1b754d0597be83439ecc8de2a59a90f35cd4040.tar.bz2
repack: free existing_cruft array after use
We allocate an array of packed_git pointers so that we can sort the list of cruft packs, but we never free the array, causing a small leak. Note that we don't need to free the packed_git structs themselves; they're owned by the repository object. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/repack.c')
-rw-r--r--builtin/repack.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/repack.c b/builtin/repack.c
index a1a893d..69e8f30 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -955,6 +955,7 @@ static void collapse_small_cruft_packs(FILE *in, size_t max_size,
existing->non_kept_packs.items[i].string);
strbuf_release(&buf);
+ free(existing_cruft);
}
static int write_cruft_pack(const struct pack_objects_args *args,