Free temporary merge index
diff --git a/src/merge.c b/src/merge.c
index 42fbd79..24b7d37 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -2629,9 +2629,8 @@ int git_merge(
on_error:
merge_state_cleanup(repo);
- git_index_free(index_new);
-
done:
+ git_index_free(index_new);
git_index_free(index_repo);
git_tree_free(ancestor_tree);