changeset 9628:fefd0551aa9d v7.4.2091

commit https://github.com/vim/vim/commit/2e45d21c819272051f7ef4436f483e4b2ecfb369 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 22 22:12:38 2016 +0200 patch 7.4.2091 Problem: Coverity reports a resource leak when out of memory. Solution: Close the file before returning.
author Christian Brabandt <cb@256bit.org>
date Fri, 22 Jul 2016 22:15:05 +0200
parents 8eef9ebbb021
children ea0c9f0a8519
files src/term.c src/version.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/term.c
+++ b/src/term.c
@@ -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);
 		}
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2091,
+/**/
     2090,
 /**/
     2089,