vim-patch:7.4.2128 (#5517)

Problem:    Memory leak when saving for undo fails.
Solution:   Free allocated memory. (Hirohito Higashi)

1e2258297b
This commit is contained in:
Michael Ennen 2016-10-26 04:27:00 -07:00 committed by Justin M. Keyes
parent 2a6c5bb0c4
commit e350902b7d
2 changed files with 6 additions and 4 deletions

View File

@ -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);

View File

@ -313,7 +313,7 @@ static int included_patches[] = {
// 2131 NA
// 2130 NA
// 2129 NA
// 2128,
2128,
// 2127,
// 2126,
// 2125,