patch 8.2.3942: Coverity reports a possible memory leak
Problem: Coverity reports a possible memory leak. Solution: Free the array if allocation fails.
This commit is contained in:
@ -3193,6 +3193,8 @@ get_next_spell_completion(linenr_T lnum UNUSED)
|
||||
num_matches = expand_spelling(lnum, compl_pattern, &matches);
|
||||
if (num_matches > 0)
|
||||
ins_compl_add_matches(num_matches, matches, p_ic);
|
||||
else
|
||||
vim_free(matches);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -749,6 +749,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
3942,
|
||||
/**/
|
||||
3941,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user