mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.2703: Vim9: memory leak when failing on locked variable
Problem: Vim9: memory leak when failing on locked variable. Solution: Free the memory.
This commit is contained in:
parent
c17ba791a9
commit
6e50ec2f0a
@ -1323,6 +1323,7 @@ def Test_var_declaration()
|
|||||||
unlet g:var_test
|
unlet g:var_test
|
||||||
unlet g:var_prefixed
|
unlet g:var_prefixed
|
||||||
unlet g:other_var
|
unlet g:other_var
|
||||||
|
unlet g:globConst
|
||||||
unlet g:FOO
|
unlet g:FOO
|
||||||
unlet g:FOOS
|
unlet g:FOOS
|
||||||
unlet g:FLIST
|
unlet g:FLIST
|
||||||
@ -1375,7 +1376,7 @@ def Test_var_declaration_fails()
|
|||||||
SetGlobalConst()
|
SetGlobalConst()
|
||||||
g:globConst = 234
|
g:globConst = 234
|
||||||
END
|
END
|
||||||
CheckScriptFailure(lines, 'E741: Value is locked: globConst', 1)
|
CheckScriptFailure(lines, 'E741: Value is locked: g:globConst', 6)
|
||||||
unlet g:globConst
|
unlet g:globConst
|
||||||
|
|
||||||
lines =<< trim END
|
lines =<< trim END
|
||||||
|
@ -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 */
|
||||||
|
/**/
|
||||||
|
2703,
|
||||||
/**/
|
/**/
|
||||||
2702,
|
2702,
|
||||||
/**/
|
/**/
|
||||||
|
@ -1944,7 +1944,10 @@ call_def_function(
|
|||||||
{
|
{
|
||||||
SOURCING_LNUM = iptr->isn_lnum;
|
SOURCING_LNUM = iptr->isn_lnum;
|
||||||
if (var_check_permission(di, name) == FAIL)
|
if (var_check_permission(di, name) == FAIL)
|
||||||
|
{
|
||||||
|
clear_tv(STACK_TV_BOT(0));
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
}
|
||||||
clear_tv(&di->di_tv);
|
clear_tv(&di->di_tv);
|
||||||
di->di_tv = *STACK_TV_BOT(0);
|
di->di_tv = *STACK_TV_BOT(0);
|
||||||
}
|
}
|
||||||
@ -1966,7 +1969,10 @@ call_def_function(
|
|||||||
// the value needs to be checked here.
|
// the value needs to be checked here.
|
||||||
SOURCING_LNUM = iptr->isn_lnum;
|
SOURCING_LNUM = iptr->isn_lnum;
|
||||||
if (value_check_lock(sv->sv_tv->v_lock, sv->sv_name, FALSE))
|
if (value_check_lock(sv->sv_tv->v_lock, sv->sv_name, FALSE))
|
||||||
|
{
|
||||||
|
clear_tv(STACK_TV_BOT(0));
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
}
|
||||||
|
|
||||||
clear_tv(sv->sv_tv);
|
clear_tv(sv->sv_tv);
|
||||||
*sv->sv_tv = *STACK_TV_BOT(0);
|
*sv->sv_tv = *STACK_TV_BOT(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user