From: Alex Riesen Date: Wed, 19 Nov 2008 11:14:05 +0000 (+0100) Subject: Fix handle leak in sha1_file/unpack_objects if there were damaged object data X-Git-Tag: v1.6.1-rc1~28 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f755bb996ba0540d668104d0e2d4e03bb71b560b;p=git.git Fix handle leak in sha1_file/unpack_objects if there were damaged object data In the case of bad packed object CRC, unuse_pack wasn't called after check_pack_crc which calls use_pack. Signed-off-by: Alex Riesen Acked-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- diff --git a/sha1_file.c b/sha1_file.c index 75a748a64..0106e2ce5 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1749,6 +1749,7 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset, error("bad packed object CRC for %s", sha1_to_hex(sha1)); mark_bad_packed_object(p, sha1); + unuse_pack(&w_curs); return NULL; } }