From e6b8893337f843d685b26f59d1982e23871956bf Mon Sep 17 00:00:00 2001 From: KillTheMule Date: Fri, 22 Apr 2016 19:47:41 +0200 Subject: 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) --- src/nvim/path.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/path.c') 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; -- cgit