From: Bram Moolenaar Date: Sat, 10 Apr 2021 18:46:48 +0000 (+0200) Subject: patch 8.2.2748: Vim9: memory leak when calling :def function fails X-Git-Tag: v8.2.2748 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4297697761230489a025b3e39b992cca845b1b3;p=vim patch 8.2.2748: Vim9: memory leak when calling :def function fails Problem: Vim9: memory leak when calling :def function fails. Solution: Jump to failed_early instead of returning. --- diff --git a/src/version.c b/src/version.c index 9fca01a86..fa3a9a8c6 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2748, /**/ 2747, /**/ diff --git a/src/vim9execute.c b/src/vim9execute.c index e7885ad70..017d5774e 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -1343,7 +1343,7 @@ call_def_function( emsg(_(e_one_argument_too_many)); else semsg(_(e_nr_arguments_too_many), idx); - return FAIL; + goto failed_early; } // Put arguments on the stack, but no more than what the function expects.