commit | 2e45d21c819272051f7ef4436f483e4b2ecfb369 | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Fri Jul 22 22:12:38 2016 +0200 |
committer | Bram Moolenaar <Bram@vim.org> | Fri Jul 22 22:12:38 2016 +0200 |
tree | 8b2fd3f2c356fc4ad4994cf6d3d9e22e2f68779f | |
parent | df48fb456fb6bf63d94cad9b302ff01d8ee8d311 [diff] [blame] |
patch 7.4.2091 Problem: Coverity reports a resource leak when out of memory. Solution: Close the file before returning.
diff --git a/src/term.c b/src/term.c index 73f1f31..506cf3c 100644 --- a/src/term.c +++ b/src/term.c
@@ -6197,7 +6197,10 @@ 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); }