patch 8.2.1733: Vim9: memory leaks when using nested function

Problem:    Vim9: memory leaks when using nested function.
Solution:   Free function when compilation fails.
This commit is contained in:
Bram Moolenaar 2020-09-23 18:51:11 +02:00
parent 6bf1b52ba2
commit 4ee711f213
2 changed files with 5 additions and 0 deletions

View File

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

View File

@ -4408,7 +4408,10 @@ compile_nested_function(exarg_T *eap, cctx_T *cctx)
return eap->skip ? (char_u *)"" : NULL;
if (ufunc->uf_def_status == UF_TO_BE_COMPILED
&& compile_def_function(ufunc, TRUE, cctx) == FAIL)
{
func_ptr_unref(ufunc);
return NULL;
}
if (is_global)
{