summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-03-18 13:49:22 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-03-18 13:49:23 -0700
commitdecba94d2c664229d16ee7c3cc442c0ada6090b9 (patch)
tree96b6f8e90cc76ecc93d928f91ba53dbf7b3d6687
parentMerge branch 'jk/diff-filespec-cleanup' (diff)
parentsha1_file: fix delta_stack memory leak in unpack_entry (diff)
downloadtgif-decba94d2c664229d16ee7c3cc442c0ada6090b9.tar.xz
Merge branch 'nd/sha1-file-delta-stack-leakage-fix'
Fix a small leak in the delta stack used when resolving a long delta chain at runtime. * nd/sha1-file-delta-stack-leakage-fix: sha1_file: fix delta_stack memory leak in unpack_entry
-rw-r--r--sha1_file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sha1_file.c b/sha1_file.c
index b37c6f67e4..18b2378d8a 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2288,6 +2288,10 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
*final_size = size;
unuse_pack(&w_curs);
+
+ if (delta_stack != small_delta_stack)
+ free(delta_stack);
+
return data;
}