Merge branch 'rs/unpack-entry-leakfix'
authorJunio C Hamano <gitster@pobox.com>
Tue, 22 Aug 2017 17:29:15 +0000 (10:29 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 Aug 2017 17:29:15 +0000 (10:29 -0700)
Memory leak in an error codepath has been plugged.

* rs/unpack-entry-leakfix:
sha1_file: release delta_stack on error in unpack_entry()

1  2 
sha1_file.c
diff --cc sha1_file.c
index 607b34ea53609a4d34e90fabc97dfef2fc6c3d05,ba282c06bd5b2863b1fa86665ce1904124d2890b..81d03ce8591ce318c0ecb0fd0491e06783a67dfc
@@@ -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)