diff options
author | Michael Ennen <brcolow@users.noreply.github.com> | 2016-10-26 04:27:00 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-10-26 13:27:00 +0200 |
commit | e350902b7de17583e3a94fa92f736aded0726774 (patch) | |
tree | 161d60a3463d692d1dc9573eae26224279b834df | |
parent | 2a6c5bb0c4b03a9da81dae64d37c9912e448eaf0 (diff) | |
download | rneovim-e350902b7de17583e3a94fa92f736aded0726774.tar.gz rneovim-e350902b7de17583e3a94fa92f736aded0726774.tar.bz2 rneovim-e350902b7de17583e3a94fa92f736aded0726774.zip |
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
-rw-r--r-- | src/nvim/ex_cmds.c | 8 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 6 insertions, 4 deletions
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, |