0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.1862: vim9: memory leak when compiling lambda fails

Problem:    vim9: memory leak when compiling lambda fails.
Solution:   Call clear_evalarg().
This commit is contained in:
Bram Moolenaar
2020-10-18 23:32:13 +02:00
parent a2c026d0fd
commit 2ea79ad835
2 changed files with 5 additions and 0 deletions

View File

@@ -2692,7 +2692,10 @@ compile_lambda(char_u **arg, cctx_T *cctx)
// Get the funcref in "rettv".
if (get_lambda_tv(arg, &rettv, &evalarg) != OK)
{
clear_evalarg(&evalarg, NULL);
return FAIL;
}
ufunc = rettv.vval.v_partial->pt_func;
++ufunc->uf_refcount;