]> granicus.if.org Git - vim/commitdiff
patch 7.4.2129 v7.4.2129
authorBram Moolenaar <Bram@vim.org>
Sat, 30 Jul 2016 20:32:11 +0000 (22:32 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 30 Jul 2016 20:32:11 +0000 (22:32 +0200)
Problem:    Memory leak when using timer_start(). (Dominique Pelle)
Solution:   Don't copy the callback when using a partial.

src/evalfunc.c
src/version.c

index f665842428e7863dedb43d4f2ee5f708c629cf9b..9905d0ba7406d66e996b760016919c8777df7f51 100644 (file)
@@ -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;
     }
 }
index 05df68e5813ae266a0e4cafa7b6ad7fbd0693ee6..90953555f89f45fe46ece3017dd1cd0390735e46 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2129,
 /**/
     2128,
 /**/