Merge branch 'fc/unpack-trees-leakfix'

* fc/unpack-trees-leakfix:
  unpack-trees: plug a memory leak
maint
Junio C Hamano 2013-09-04 12:36:41 -07:00
commit 94f00694e2
1 changed files with 3 additions and 1 deletions

View File

@ -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);