Commit e759b072 by Edward Thomson

don't walk off the end of the index

parent 6cacd44b
...@@ -957,13 +957,14 @@ int git_index_conflict_remove(git_index *index, const char *path) ...@@ -957,13 +957,14 @@ int git_index_conflict_remove(git_index *index, const char *path)
continue; continue;
} }
error = git_vector_remove(&index->entries, (unsigned int)pos); if ((error = git_vector_remove(&index->entries, (unsigned int)pos)) < 0)
return error;
if (error >= 0) index_entry_free(conflict_entry);
index_entry_free(conflict_entry); posmax--;
} }
return error; return 0;
} }
static int index_conflicts_match(const git_vector *v, size_t idx) static int index_conflicts_match(const git_vector *v, size_t idx)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment