From: Bram Moolenaar Date: Fri, 15 Jul 2016 19:29:35 +0000 (+0200) Subject: patch 7.4.2045 X-Git-Tag: v7.4.2045 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ef2e762844e0eb1f5b213bd58e6bc38bdb69dac;p=vim patch 7.4.2045 Problem: Memory leak when using a function callback. Solution: Don't save the function name when it's in the partial. --- diff --git a/src/channel.c b/src/channel.c index 90ef9741a..ae5bdf220 100644 --- a/src/channel.c +++ b/src/channel.c @@ -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; diff --git a/src/version.c b/src/version.c index 745bfd223..cd8019740 100644 --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2045, /**/ 2044, /**/