]> git.ipfire.org Git - thirdparty/git.git/commitdiff
packfile: release bad_objects in close_pack()
authorRené Scharfe <l.s.r@web.de>
Fri, 24 Sep 2021 06:10:10 +0000 (08:10 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Sep 2021 16:22:46 +0000 (09:22 -0700)
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>
packfile.c

index ea29f4ba77356049ea80bcf9b5276d8781910d7c..8318ce5afd0776b85434ba8ec9e880ef3afc97b4 100644 (file)
@@ -339,6 +339,7 @@ void close_pack(struct packed_git *p)
        close_pack_fd(p);
        close_pack_index(p);
        close_pack_revindex(p);
+       oidset_clear(&p->bad_objects);
 }
 
 void close_object_store(struct raw_object_store *o)