diff options
| author | Patrick Steinhardt <ps@pks.im> | 2015-12-08 16:00:35 +0100 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2015-12-08 16:29:08 +0100 |
| commit | b057fdef694a558221784b534de66fe15dff5782 (patch) | |
| tree | 36561dd14405e5459f560fa83f205b591580a0f2 /include/git2 | |
| parent | 15e6a5afb9217b09e60cd0aef48e0a7781f3922f (diff) | |
| download | libgit2-b057fdef694a558221784b534de66fe15dff5782.tar.gz | |
index: always queue `remove_entry` for removal
When replacing an index with a new one, we need to iterate
through all index entries in order to determine which entries are
equal. When it is not possible to re-use old entries for the new
index, we move it into a list of entries that are to be removed
and thus free'd.
When we encounter a non-zero error code, though, we skip adding
the current index entry to the remove-queue. `INSERT_MAP_EX`,
which is the function last run before adding to the remove-queue,
may return a positive non-zero code that indicates what exactly
happened while inserting the element. In this case we skip adding
the entry to the remove-queue but still continue the current
operation, leading to a leak of the current entry.
Fix this by checking for a negative return value instead of a
non-zero one when we want to add the current index entry to the
remove-queue.
Diffstat (limited to 'include/git2')
0 files changed, 0 insertions, 0 deletions
