]> granicus.if.org Git - vim/commitdiff
patch 8.2.3931: Coverity reports a memory leak v8.2.3931
authorBram Moolenaar <Bram@vim.org>
Wed, 29 Dec 2021 11:59:53 +0000 (11:59 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 29 Dec 2021 11:59:53 +0000 (11:59 +0000)
Problem:    Coverity reports a memory leak.
Solution:   Free memory in case of failure.

src/diff.c
src/version.c

index 9fb8726b4d4a92edea37d7f2da04591b891479cf..d42233889cb591d1ee855414c218923a28761b6c 100644 (file)
@@ -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;
index b752bc4c7965be479ee59f418e4fe6f9a2dfdf2f..09bce7b944ecc0524aea5db911114275807cedc4 100644 (file)
@@ -749,6 +749,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3931,
 /**/
     3930,
 /**/