]> granicus.if.org Git - vim/commitdiff
patch 7.4.2128 v7.4.2128
authorBram Moolenaar <Bram@vim.org>
Sat, 30 Jul 2016 19:48:59 +0000 (21:48 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 30 Jul 2016 19:48:59 +0000 (21:48 +0200)
Problem:    Memory leak when saving for undo fails.
Solution:   Free allocated memory. (Hirohito Higashi)

src/ex_cmds.c
src/version.c

index 860d3dc9848038c5cdeac6aaea3d412aaa536de1..e40e435907fb6eeca39c1165e8f7ceb20d8f00df 100644 (file)
@@ -4091,7 +4091,10 @@ do_ecmd(
            u_sync(FALSE);
            if (u_savecommon(0, curbuf->b_ml.ml_line_count + 1, 0, TRUE)
                                                                     == FAIL)
+           {
+               vim_free(new_name);
                goto theend;
+           }
            u_unchanged(curbuf);
            buf_freeall(curbuf, BFA_KEEP_UNDO);
 
index 513712198a1a85992a6e16a5204df879fcbbd50c..05df68e5813ae266a0e4cafa7b6ad7fbd0693ee6 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2128,
 /**/
     2127,
 /**/