Commit fc2ef5143b5ee5aaddb56bbff98815cea5241244

Patrick Steinhardt 2016-05-02T14:30:14

index: fix memory leak on error case

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/index.c b/src/index.c
index 63e4796..31cb27d 100644
--- a/src/index.c
+++ b/src/index.c
@@ -3008,7 +3008,7 @@ int git_index_read_index(
 
 		if (error < 0) {
 			giterr_set(GITERR_INDEX, "failed to insert entry");
-			return error;
+			goto done;
 		}
 
 		if (diff <= 0) {