Skip to content

Commit 8c6b433

Browse files
rscharfegitster
authored andcommitted
packfile: release bad_objects in close_pack()
Unusable entries of a damaged pack file are recorded in the oidset bad_objects. Release it when we're done with the pack. This doesn't affect intact packs because an empty oidset requires no allocation. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 48bf2fa commit 8c6b433

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packfile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ void close_pack(struct packed_git *p)
339339
close_pack_fd(p);
340340
close_pack_index(p);
341341
close_pack_revindex(p);
342+
oidset_clear(&p->bad_objects);
342343
}
343344

344345
void close_object_store(struct raw_object_store *o)

0 commit comments

Comments
 (0)