Skip to content

Commit 1e22582

Browse files
committed
patch 7.4.2128
Problem: Memory leak when saving for undo fails. Solution: Free allocated memory. (Hirohito Higashi)
1 parent 3bcfca3 commit 1e22582

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/ex_cmds.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4091,7 +4091,10 @@ do_ecmd(
40914091
u_sync(FALSE);
40924092
if (u_savecommon(0, curbuf->b_ml.ml_line_count + 1, 0, TRUE)
40934093
== FAIL)
4094+
{
4095+
vim_free(new_name);
40944096
goto theend;
4097+
}
40954098
u_unchanged(curbuf);
40964099
buf_freeall(curbuf, BFA_KEEP_UNDO);
40974100

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2128,
766768
/**/
767769
2127,
768770
/**/

0 commit comments

Comments
 (0)