Commit 5b0258add926c9d17c88984d4aaf085e2a091919

Edward Thomson 2018-08-19T23:01:38

Merge pull request #4768 from abyss7/master Fix leak in index.c

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/index.c b/src/index.c
index 4907c81..0450d9f 100644
--- a/src/index.c
+++ b/src/index.c
@@ -1802,7 +1802,8 @@ int git_index_conflict_add(git_index *index,
 		if (entries[i] && !valid_filemode(entries[i]->mode)) {
 			giterr_set(GITERR_INDEX, "invalid filemode for stage %d entry",
 				i + 1);
-			return -1;
+			ret = -1;
+			goto on_error;
 		}
 	}