Commit cef170ab by Russell Belfer

Fix leak when using push and pop with ignores

The iterator pushes and pops ignores incrementally onto a list as
it traverses the directory structure so that it doesn't have to
constantly recheck which ignore files apply.  With the new ref
counting, it wasn't decrementing the refcount on the ignores that
it removed from the vector.
parent b8777615
...@@ -191,8 +191,11 @@ int git_ignore__pop_dir(git_ignores *ign) ...@@ -191,8 +191,11 @@ int git_ignore__pop_dir(git_ignores *ign)
if (ign->dir.size >= keylen && if (ign->dir.size >= keylen &&
!memcmp(ign->dir.ptr + ign->dir.size - keylen, start, keylen)) !memcmp(ign->dir.ptr + ign->dir.size - keylen, start, keylen))
{
git_attr_file__free(git_vector_last(&ign->ign_path));
git_vector_pop(&ign->ign_path); git_vector_pop(&ign->ign_path);
} }
}
if (--ign->depth > 0) { if (--ign->depth > 0) {
git_buf_rtruncate_at_char(&ign->dir, '/'); git_buf_rtruncate_at_char(&ign->dir, '/');
......
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