From e350902b7de17583e3a94fa92f736aded0726774 Mon Sep 17 00:00:00 2001 From: Michael Ennen Date: Wed, 26 Oct 2016 04:27:00 -0700 Subject: vim-patch:7.4.2128 (#5517) Problem: Memory leak when saving for undo fails. Solution: Free allocated memory. (Hirohito Higashi) https://github.com/vim/vim/commit/1e2258297bb31720bfbeb234f2dae4d1b3b04fbd --- src/nvim/ex_cmds.c | 8 +++++--- src/nvim/version.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 6205daf0cb..96eeff8973 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -2370,10 +2370,12 @@ do_ecmd ( if (p_ur < 0 || curbuf->b_ml.ml_line_count <= p_ur) { /* Save all the text, so that the reload can be undone. * Sync first so that this is a separate undo-able action. */ - u_sync(FALSE); - if (u_savecommon(0, curbuf->b_ml.ml_line_count + 1, 0, TRUE) - == FAIL) + u_sync(false); + if (u_savecommon(0, curbuf->b_ml.ml_line_count + 1, 0, true) + == FAIL) { + xfree(new_name); goto theend; + } u_unchanged(curbuf); buf_freeall(curbuf, BFA_KEEP_UNDO); diff --git a/src/nvim/version.c b/src/nvim/version.c index b4c76de580..29c0532a7f 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -313,7 +313,7 @@ static int included_patches[] = { // 2131 NA // 2130 NA // 2129 NA - // 2128, + 2128, // 2127, // 2126, // 2125, -- cgit