From: Junio C Hamano Date: Sun, 10 Sep 2017 08:02:53 +0000 (+0900) Subject: Merge branch 'rs/unpack-entry-leakfix' into maint X-Git-Tag: v2.14.2~30 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/438776e3d48779417a7f9cfc6eaf0bb58d7d6cca?hp=--cc 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() --- 438776e3d48779417a7f9cfc6eaf0bb58d7d6cca diff --cc sha1_file.c index b60ae15f70,ba282c06bd..b7bb38b445 --- a/sha1_file.c +++ b/sha1_file.c @@@ -2676,11 -2596,10 +2676,12 @@@ void *unpack_entry(struct packed_git *p free(external_base); } - *final_type = type; - *final_size = size; + if (final_type) + *final_type = type; + if (final_size) + *final_size = size; + out: unuse_pack(&w_curs); if (delta_stack != small_delta_stack)