summaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-30 21:48:59 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-30 21:48:59 +0200
commit1e2258297bb31720bfbeb234f2dae4d1b3b04fbd (patch)
tree4cb2b97e1a8e8a693ed7de8f4758faf9adf7dd51 /src/ex_cmds.c
parent3bcfca3ab4db415d0e750e00204dd25a91fcee77 (diff)
downloadvim-git-1e2258297bb31720bfbeb234f2dae4d1b3b04fbd.tar.gz
patch 7.4.2128v7.4.2128
Problem: Memory leak when saving for undo fails. Solution: Free allocated memory. (Hirohito Higashi)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 860d3dc98..e40e43590 100644
--- 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);