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>

Jeff King committed Oct 7, 2023 at 13:20 UTC c1b754d0597be83439ecc8de2a59a90f35cd4040
1 file changed +1
builtin/repack.c
+1
@@ -955,6 +955,7 @@ static void collapse_small_cruft_packs(FILE *in, size_t max_size,
955 existing->non_kept_packs.items[i].string);
956
957 strbuf_release(&buf);
958 + free(existing_cruft);
959 }
960
961 static int write_cruft_pack(const struct pack_objects_args *args,