]> granicus.if.org Git - vim/commitdiff
patch 7.4.2045 v7.4.2045
authorBram Moolenaar <Bram@vim.org>
Fri, 15 Jul 2016 19:29:35 +0000 (21:29 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 15 Jul 2016 19:29:35 +0000 (21:29 +0200)
Problem:    Memory leak when using a function callback.
Solution:   Don't save the function name when it's in the partial.

src/channel.c
src/version.c

index 90ef9741af06dbbde7ba4bafaf6210ec10385ea9..ae5bdf220bb7afded9132f1890d750c9d25cf8bb 100644 (file)
@@ -1122,7 +1122,12 @@ set_callback(
 {
     free_callback(*cbp, *pp);
     if (callback != NULL && *callback != NUL)
-       *cbp = vim_strsave(callback);
+    {
+       if (partial != NULL)
+           *cbp = partial->pt_name;
+       else
+           *cbp = vim_strsave(callback);
+    }
     else
        *cbp = NULL;
     *pp = partial;
index 745bfd22304b661d8d9cdff5321cc5c15707a5cc..cd80197405cad4815e0dbbf40161559d5bfc4a28 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2045,
 /**/
     2044,
 /**/