changeset 9705:8c0871098dc9 v7.4.2128

commit https://github.com/vim/vim/commit/1e2258297bb31720bfbeb234f2dae4d1b3b04fbd Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 30 21:48:59 2016 +0200 patch 7.4.2128 Problem: Memory leak when saving for undo fails. Solution: Free allocated memory. (Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Sat, 30 Jul 2016 22:00:06 +0200
parents 6c4e32f214b0
children cfb88f2201d5
files src/ex_cmds.c src/version.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -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);
 
--- a/src/version.c
+++ b/src/version.c
@@ -764,6 +764,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2128,
+/**/
     2127,
 /**/
     2126,