summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2021-09-24 06:10:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-24 16:22:46 (GMT)
commit8c6b4332b47792947f29d3abd729b8290add96fd (patch)
treec06eb98d09562a6f55249f0bcc318f4615f69268
parent48bf2fa8bad054d66bd79c6ba903c89c704201f7 (diff)
downloadgit-8c6b4332b47792947f29d3abd729b8290add96fd.zip
git-8c6b4332b47792947f29d3abd729b8290add96fd.tar.gz
git-8c6b4332b47792947f29d3abd729b8290add96fd.tar.bz2
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>
-rw-r--r--packfile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/packfile.c b/packfile.c
index ea29f4b..8318ce5 100644
--- a/packfile.c
+++ b/packfile.c
@@ -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)