mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 23:38:17 +00:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user