diff --git a/unpack-trees.c b/unpack-trees.c index ad3e9a04fe..2515be6a60 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1157,6 +1157,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options if (o->dst_index) { discard_index(o->dst_index); *o->dst_index = o->result; + } else { + discard_index(&o->result); } done: