From: Jeff King Date: Sat, 7 Oct 2023 17:20:31 +0000 (-0400) Subject: repack: free existing_cruft array after use X-Git-Tag: v2.43.0-rc0~33^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1b754d0597be83439ecc8de2a59a90f35cd4040;p=thirdparty%2Fgit.git 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 Acked-by: Taylor Blau Signed-off-by: Junio C Hamano --- diff --git a/builtin/repack.c b/builtin/repack.c index a1a893d952..69e8f302c0 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,