mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
2a6c5bb0c4
commit
e350902b7d
@ -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);
|
||||
|
||||
|
@ -313,7 +313,7 @@ static int included_patches[] = {
|
||||
// 2131 NA
|
||||
// 2130 NA
|
||||
// 2129 NA
|
||||
// 2128,
|
||||
2128,
|
||||
// 2127,
|
||||
// 2126,
|
||||
// 2125,
|
||||
|
Loading…
Reference in New Issue
Block a user