diff options
author | Alex Riesen <raa.lkml@gmail.com> | 2008-11-19 12:14:05 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-11-23 19:31:05 -0800 |
commit | f755bb996ba0540d668104d0e2d4e03bb71b560b (patch) | |
tree | ed4e9a04d59f4c960f6c671e8fde9cd34a909ab0 /sha1_file.c | |
parent | 6fc4a7e546d5e2b0ce545f73b5c1829887db2462 (diff) | |
download | git-f755bb996ba0540d668104d0e2d4e03bb71b560b.tar.gz git-f755bb996ba0540d668104d0e2d4e03bb71b560b.tar.xz |
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 <raa.lkml@gmail.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } } |