forked from aniani/vim
patch 7.4.2091
Problem: Coverity reports a resource leak when out of memory. Solution: Close the file before returning.
This commit is contained in:
@@ -6197,7 +6197,10 @@ gui_get_color_cmn(char_u *name)
|
||||
char_u *s = vim_strsave((char_u *)line + pos);
|
||||
|
||||
if (s == NULL)
|
||||
{
|
||||
fclose(fd);
|
||||
return INVALCOLOR;
|
||||
}
|
||||
colornames_table[size].color_name = s;
|
||||
colornames_table[size].color = (guicolor_T)RGB(r, g, b);
|
||||
}
|
||||
|
@@ -758,6 +758,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2091,
|
||||
/**/
|
||||
2090,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user