diff options
author | Russell Belfer <rb@github.com> | 2014-03-14 15:37:42 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-04-17 14:43:46 -0700 |
commit | b87776151ad40caaec8bfe1becec4db429c9ea96 (patch) | |
tree | a7f30cf169f81a3aaadd906e4e8ea65991e26a58 /src/ignore.c | |
parent | 3816debc13e8d5b96ad40be95a09fe67f6fa5a96 (diff) | |
download | libgit2-b87776151ad40caaec8bfe1becec4db429c9ea96.tar.gz |
Fix refcount issues with mutex protected ignores
Some ignore files were not being freed from the cache.
Diffstat (limited to 'src/ignore.c')
-rw-r--r-- | src/ignore.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ignore.c b/src/ignore.c index 5cf4fca5c..9b3c6a8bc 100644 --- a/src/ignore.c +++ b/src/ignore.c @@ -204,9 +204,23 @@ int git_ignore__pop_dir(git_ignores *ign) void git_ignore__free(git_ignores *ignores) { - /* don't need to free ignores->ign_internal since it is in cache */ + unsigned int i; + git_attr_file *file; + + /* don't need to free ignores->ign_internal it is cached exactly once */ + + git_vector_foreach(&ignores->ign_path, i, file) { + git_attr_file__free(file); + ignores->ign_path.contents[i] = NULL; + } git_vector_free(&ignores->ign_path); + + git_vector_foreach(&ignores->ign_global, i, file) { + git_attr_file__free(file); + ignores->ign_global.contents[i] = NULL; + } git_vector_free(&ignores->ign_global); + git_buf_free(&ignores->dir); } |