Skip to content

Commit f755bb9

Browse files
raalkmlgitster
authored andcommitted
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 <[email protected]> Acked-by: Nicolas Pitre <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6fc4a7e commit f755bb9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sha1_file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,7 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
17491749
error("bad packed object CRC for %s",
17501750
sha1_to_hex(sha1));
17511751
mark_bad_packed_object(p, sha1);
1752+
unuse_pack(&w_curs);
17521753
return NULL;
17531754
}
17541755
}

0 commit comments

Comments
 (0)