Skip to content

Commit 2e45d21

Browse files
committed
patch 7.4.2091
Problem: Coverity reports a resource leak when out of memory. Solution: Close the file before returning.
1 parent df48fb4 commit 2e45d21

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/term.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6197,7 +6197,10 @@ gui_get_color_cmn(char_u *name)
61976197
char_u *s = vim_strsave((char_u *)line + pos);
61986198

61996199
if (s == NULL)
6200+
{
6201+
fclose(fd);
62006202
return INVALCOLOR;
6203+
}
62016204
colornames_table[size].color_name = s;
62026205
colornames_table[size].color = (guicolor_T)RGB(r, g, b);
62036206
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ static char *(features[]) =
758758

759759
static int included_patches[] =
760760
{ /* Add new patch number below this line */
761+
/**/
762+
2091,
761763
/**/
762764
2090,
763765
/**/

0 commit comments

Comments
 (0)