changeset 26805:77ff030699d2 v8.2.3931

patch 8.2.3931: Coverity reports a memory leak Commit: https://github.com/vim/vim/commit/febb78fa1798e0f95983b3f7881419a754886df5 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 29 11:59:53 2021 +0000 patch 8.2.3931: Coverity reports a memory leak Problem: Coverity reports a memory leak. Solution: Free memory in case of failure.
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 Dec 2021 13:00:05 +0100
parents 34f1b7d6974a
children eb2ef75a9abd
files src/diff.c src/version.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/diff.c
+++ b/src/diff.c
@@ -3310,7 +3310,10 @@ xdiff_out(
 	return -1;
 
     if (ga_grow(&dout->dout_ga, 1) == FAIL)
+    {
+	vim_free(p);
 	return -1;
+    }
 
     p->lnum_orig  = start_a + 1;
     p->count_orig = count_a;
--- a/src/version.c
+++ b/src/version.c
@@ -750,6 +750,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3931,
+/**/
     3930,
 /**/
     3929,