Skip to content

Commit

Permalink
Fix handle leak in sha1_file/unpack_objects if there were damaged obj…
Browse files Browse the repository at this point in the history
…ect 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>
  • Loading branch information
Alex Riesen authored and Junio C Hamano committed Nov 24, 2008
1 parent 6fc4a7e commit f755bb9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit f755bb9

Please sign in to comment.