changeset 23831:7c257af6ccf5 v8.2.2457

patch 8.2.2457: Coverity warns for memory leak Commit: https://github.com/vim/vim/commit/4dba04256b8a49b201d685217d3d7abc4988f090 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 3 19:35:13 2021 +0100 patch 8.2.2457: Coverity warns for memory leak Problem: Coverity warns for memory leak. Solution: Free memory when out of memory.
author Bram Moolenaar <Bram@vim.org>
date Wed, 03 Feb 2021 19:45:05 +0100
parents 6e5a62752f93
children 17d43bc61e08
files src/if_cscope.c src/version.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -1813,7 +1813,10 @@ cs_file_results(FILE *f, int *nummatches
 
 	   context = alloc(strlen(cntx)+5);
 	   if (context == NULL)
+	   {
+	       vim_free(fullname);
 	       continue;
+	   }
 
 	   if (strcmp(cntx, "<global>")==0)
 	       strcpy(context, "<<global>>");
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2457,
+/**/
     2456,
 /**/
     2455,