diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-08-22 10:29:15 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-22 10:29:15 -0700 |
commit | 030e2938d2a6f864da37a6b0a29aeb3e16994895 (patch) | |
tree | 4027fee137efeca0e1b7c73d693d2352ca1a37f9 | |
parent | 0c493966ff6af8d2217aaa40dd6f7916bd992b0a (diff) | |
parent | 896dca3ab75de69e292d7863d704b3e7a8f1a59d (diff) | |
download | git-030e2938d2a6f864da37a6b0a29aeb3e16994895.tar.gz git-030e2938d2a6f864da37a6b0a29aeb3e16994895.tar.xz |
Merge branch 'rs/unpack-entry-leakfix'
Memory leak in an error codepath has been plugged.
* rs/unpack-entry-leakfix:
sha1_file: release delta_stack on error in unpack_entry()
-rw-r--r-- | sha1_file.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c index 607b34ea5..81d03ce85 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -2542,8 +2542,8 @@ 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; + data = NULL; + goto out; } } @@ -2681,6 +2681,7 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset, if (final_size) *final_size = size; +out: unuse_pack(&w_curs); if (delta_stack != small_delta_stack) |