mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -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:
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1862,
|
||||||
/**/
|
/**/
|
||||||
1861,
|
1861,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -2692,7 +2692,10 @@ compile_lambda(char_u **arg, cctx_T *cctx)
|
|||||||
|
|
||||||
// Get the funcref in "rettv".
|
// Get the funcref in "rettv".
|
||||||
if (get_lambda_tv(arg, &rettv, &evalarg) != OK)
|
if (get_lambda_tv(arg, &rettv, &evalarg) != OK)
|
||||||
|
{
|
||||||
|
clear_evalarg(&evalarg, NULL);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
ufunc = rettv.vval.v_partial->pt_func;
|
ufunc = rettv.vval.v_partial->pt_func;
|
||||||
++ufunc->uf_refcount;
|
++ufunc->uf_refcount;
|
||||||
|
Reference in New Issue
Block a user