forked from aniani/vim
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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user