mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.3942: Coverity reports a possible memory leak
Problem: Coverity reports a possible memory leak.
Solution: Free the array if allocation fails.
8e7cc6b920
This commit is contained in:
parent
674d3b2d5f
commit
45d09b46ce
@ -2820,6 +2820,8 @@ static void get_next_spell_completion(linenr_T lnum)
|
|||||||
int num_matches = expand_spelling(lnum, (char_u *)compl_pattern, &matches);
|
int num_matches = expand_spelling(lnum, (char_u *)compl_pattern, &matches);
|
||||||
if (num_matches > 0) {
|
if (num_matches > 0) {
|
||||||
ins_compl_add_matches(num_matches, matches, p_ic);
|
ins_compl_add_matches(num_matches, matches, p_ic);
|
||||||
|
} else {
|
||||||
|
xfree(matches);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user