1
0
forked from aniani/vim

patch 8.2.3241: Vim9: memory leak when function reports an error

Problem:    Vim9: memory leak when function reports an error.
Solution:   Clear the return value.
This commit is contained in:
Bram Moolenaar
2021-07-28 22:21:23 +02:00
parent 2a4bd00cef
commit 6e850a6900
2 changed files with 5 additions and 0 deletions

View File

@@ -1691,9 +1691,12 @@ get_func_tv(
ret = call_func(name, len, rettv, argcount, argvars, funcexe);
if (in_vim9script() && did_emsg > did_emsg_before)
{
// An error in a builtin function does not return FAIL, but we do
// want to abort further processing if an error was given.
ret = FAIL;
clear_tv(rettv);
}
funcargs.ga_len -= i;
}

View File

@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3241,
/**/
3240,
/**/