]> granicus.if.org Git - vim/commitdiff
patch 8.2.2457: Coverity warns for memory leak v8.2.2457
authorBram Moolenaar <Bram@vim.org>
Wed, 3 Feb 2021 18:35:13 +0000 (19:35 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 3 Feb 2021 18:35:13 +0000 (19:35 +0100)
Problem:    Coverity warns for memory leak.
Solution:   Free memory when out of memory.

src/if_cscope.c
src/version.c

index bbb429ab9123e827fb12c03cca0834ef4278a1ca..f52316faec245459c538bb67d80dd4ddfb03ed4d 100644 (file)
@@ -1813,7 +1813,10 @@ cs_file_results(FILE *f, int *nummatches_a)
 
           context = alloc(strlen(cntx)+5);
           if (context == NULL)
+          {
+              vim_free(fullname);
               continue;
+          }
 
           if (strcmp(cntx, "<global>")==0)
               strcpy(context, "<<global>>");
index 804899f0644c27a846dcab38132504885ab8e51f..ab00e37c79ed790fc85c5e5f2aa7a5e7afc2ee67 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2457,
 /**/
     2456,
 /**/