Skip to content

Commit 3ab1435

Browse files
committed
patch 7.4.2129
Problem: Memory leak when using timer_start(). (Dominique Pelle) Solution: Don't copy the callback when using a partial.
1 parent 1e22582 commit 3ab1435

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/evalfunc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11931,7 +11931,11 @@ f_timer_start(typval_T *argvars, typval_T *rettv)
1193111931
}
1193211932
else
1193311933
{
11934-
timer->tr_callback = vim_strsave(callback);
11934+
if (timer->tr_partial == NULL)
11935+
timer->tr_callback = vim_strsave(callback);
11936+
else
11937+
/* pointer into the partial */
11938+
timer->tr_callback = callback;
1193511939
rettv->vval.v_number = timer->tr_id;
1193611940
}
1193711941
}

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+
2129,
766768
/**/
767769
2128,
768770
/**/

0 commit comments

Comments
 (0)