Skip to content

Commit

Permalink
Merge branch 'fc/unpack-trees-leakfix'
Browse files Browse the repository at this point in the history
* fc/unpack-trees-leakfix:
  unpack-trees: plug a memory leak
  • Loading branch information
Junio C Hamano committed Sep 4, 2013
2 parents a62b071 + e28f764 commit 94f0069
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion unpack-trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,10 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options

o->src_index = NULL;
ret = check_updates(o) ? (-2) : 0;
if (o->dst_index)
if (o->dst_index) {
discard_index(o->dst_index);
*o->dst_index = o->result;
}

done:
clear_exclude_list(&el);
Expand Down

0 comments on commit 94f0069

Please sign in to comment.