Commit dc49eb585f012ea8df309d90396873f91b2d3ae5

Carlos Martín Nieto 2015-12-10T11:57:44

Merge pull request #3538 from pks-t/pks/index-memory-leak index: always queue `remove_entry` for removal

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/index.c b/src/index.c
index 391738e..26cd838 100644
--- a/src/index.c
+++ b/src/index.c
@@ -3014,7 +3014,7 @@ int git_index_read_index(
 				INSERT_IN_MAP_EX(index, new_entries_map, add_entry, error);
 		}
 
-		if (remove_entry && !error)
+		if (remove_entry && error >= 0)
 			error = git_vector_insert(&remove_entries, remove_entry);
 
 		if (error < 0) {