Browse Source

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>
maint
Alex Riesen 16 years ago committed by Junio C Hamano
parent
commit
f755bb996b
  1. 1
      sha1_file.c

1
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", error("bad packed object CRC for %s",
sha1_to_hex(sha1)); sha1_to_hex(sha1));
mark_bad_packed_object(p, sha1); mark_bad_packed_object(p, sha1);
unuse_pack(&w_curs);
return NULL; return NULL;
} }
} }

Loading…
Cancel
Save