Skip to content

Commit 94f0069

Browse files
committed
Merge branch 'fc/unpack-trees-leakfix'
* fc/unpack-trees-leakfix: unpack-trees: plug a memory leak
2 parents a62b071 + e28f764 commit 94f0069

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

unpack-trees.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,8 +1154,10 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
11541154

11551155
o->src_index = NULL;
11561156
ret = check_updates(o) ? (-2) : 0;
1157-
if (o->dst_index)
1157+
if (o->dst_index) {
1158+
discard_index(o->dst_index);
11581159
*o->dst_index = o->result;
1160+
}
11591161

11601162
done:
11611163
clear_exclude_list(&el);

0 commit comments

Comments
 (0)