# HG changeset patch # User Bram Moolenaar # Date 1618081204 -7200 # Node ID 1754622e1bce7158daddbc3f9d55c84092a40ec3 # Parent 5a28c3b69079c8414f74553c44a931608c5280de patch 8.2.2748: Vim9: memory leak when calling :def function fails Commit: https://github.com/vim/vim/commit/c4297697761230489a025b3e39b992cca845b1b3 Author: Bram Moolenaar Date: Sat Apr 10 20:46:48 2021 +0200 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 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2748, +/**/ 2747, /**/ 2746, diff --git a/src/vim9execute.c b/src/vim9execute.c --- 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.