]> granicus.if.org Git - vim/commitdiff
patch 7.4.2091 v7.4.2091
authorBram Moolenaar <Bram@vim.org>
Fri, 22 Jul 2016 20:12:38 +0000 (22:12 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 22 Jul 2016 20:12:38 +0000 (22:12 +0200)
Problem:    Coverity reports a resource leak when out of memory.
Solution:   Close the file before returning.

src/term.c
src/version.c

index 73f1f317b54df08cfe0599b5f2b9aaa1597096ea..506cf3c086a6eaf52ad39ddef4f88d12cd8c92d8 100644 (file)
@@ -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);
                }
index e42229eea03e5f28d01808fbd7bbf7b3f698f3b9..f7eb5ceea46dd34b24c01dd041ccc651a1b0fd96 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2091,
 /**/
     2090,
 /**/