vim-patch:7.4.871

Problem:    Vim leaks memory, when 'wildignore' filters out all matches.
Solution:   Free the files array when it becomes empty.

7b256fe744

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)
This commit is contained in:
KillTheMule
2016-04-22 19:47:41 +02:00
parent c107d4a2d6
commit e6b8893337

View File

@@ -1986,6 +1986,7 @@ int expand_wildcards(int num_pat, char_u **pat, int *num_files, char_u ***files,
if (*num_files == 0) { if (*num_files == 0) {
xfree(*files); xfree(*files);
*files = NULL; *files = NULL;
return FAIL;
} }
return retval; return retval;