diff src/ex_cmds.c @ 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 88e8bca71d75
children dc2237f19ce2
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);