aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKillTheMule <KillTheMule@users.noreply.github.com>2016-04-22 19:47:41 +0200
committerKillTheMule <KillTheMule@users.noreply.github.com>2016-04-22 20:19:36 +0200
commite6b8893337f843d685b26f59d1982e23871956bf (patch)
tree2efcb08590d2a93e6633882458c68f47454f9c7d
parentc107d4a2d640f00380a97f59499d65da7abf9118 (diff)
downloadrneovim-e6b8893337f843d685b26f59d1982e23871956bf.tar.gz
rneovim-e6b8893337f843d685b26f59d1982e23871956bf.tar.bz2
rneovim-e6b8893337f843d685b26f59d1982e23871956bf.zip
vim-patch:7.4.871
Problem: Vim leaks memory, when 'wildignore' filters out all matches. Solution: Free the files array when it becomes empty. https://github.com/vim/vim/commit/7b256fe7445b46929f660ea74e9090418f857696 The only nontrivial part of 7.4.871 missing (renamings of variables are in another commit; freeing *files after 0 matches was already there, just FAIL was not returned in that case)
-rw-r--r--src/nvim/path.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 1fe0a1040c..f2b0662eac 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -1986,6 +1986,7 @@ int expand_wildcards(int num_pat, char_u **pat, int *num_files, char_u ***files,
if (*num_files == 0) {
xfree(*files);
*files = NULL;
+ return FAIL;
}
return retval;