From: Bram Moolenaar Date: Sat, 30 Jul 2016 20:32:11 +0000 (+0200) Subject: patch 7.4.2129 X-Git-Tag: v7.4.2129 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ab14355ed93958433eec58e96ec9bd9a472f2b2;p=vim patch 7.4.2129 Problem: Memory leak when using timer_start(). (Dominique Pelle) Solution: Don't copy the callback when using a partial. --- diff --git a/src/evalfunc.c b/src/evalfunc.c index f66584242..9905d0ba7 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -11931,7 +11931,11 @@ f_timer_start(typval_T *argvars, typval_T *rettv) } else { - timer->tr_callback = vim_strsave(callback); + if (timer->tr_partial == NULL) + timer->tr_callback = vim_strsave(callback); + else + /* pointer into the partial */ + timer->tr_callback = callback; rettv->vval.v_number = timer->tr_id; } } diff --git a/src/version.c b/src/version.c index 05df68e58..90953555f 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2129, /**/ 2128, /**/