Skip to content

Commit c1b754d

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Acked-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3c1e2c2 commit c1b754d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/repack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,7 @@ static void collapse_small_cruft_packs(FILE *in, size_t max_size,
955955
existing->non_kept_packs.items[i].string);
956956

957957
strbuf_release(&buf);
958+
free(existing_cruft);
958959
}
959960

960961
static int write_cruft_pack(const struct pack_objects_args *args,

0 commit comments

Comments
 (0)