mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.0089: crash when running out of memory in :setfiletype completion
Problem: Crash when running out of memory in :setfiletype completion.
Solution: Do not allocate memory. (Dominique Pelle, closes vim/vim#5438)
f0f8055102
This commit is contained in:
parent
dd4018947c
commit
f5c1314cb0
@ -5361,12 +5361,12 @@ void globpath(char_u *path, char_u *file, garray_T *ga, int expand_options)
|
||||
|
||||
// Concatenate new results to previous ones.
|
||||
ga_grow(ga, num_p);
|
||||
// take over the pointers and put them in "ga"
|
||||
for (int i = 0; i < num_p; i++) {
|
||||
((char_u **)ga->ga_data)[ga->ga_len] = vim_strsave(p[i]);
|
||||
((char_u **)ga->ga_data)[ga->ga_len] = p[i];
|
||||
ga->ga_len++;
|
||||
}
|
||||
|
||||
FreeWild(num_p, p);
|
||||
xfree(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user