提交 438776e3 编写于 作者: J Junio C Hamano

Merge branch 'rs/unpack-entry-leakfix' into maint

Memory leak in an error codepath has been plugged.

* rs/unpack-entry-leakfix:
  sha1_file: release delta_stack on error in unpack_entry()
...@@ -2542,8 +2542,8 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset, ...@@ -2542,8 +2542,8 @@ 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); data = NULL;
return NULL; goto out;
} }
} }
...@@ -2681,6 +2681,7 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset, ...@@ -2681,6 +2681,7 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
if (final_size) if (final_size)
*final_size = size; *final_size = size;
out:
unuse_pack(&w_curs); unuse_pack(&w_curs);
if (delta_stack != small_delta_stack) if (delta_stack != small_delta_stack)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册