mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.2.2101: Vim9: memory leak when literal dict has an error
Problem: Vim9: memory leak when literal dict has an error and when an expression is not complete. Solution: Clear the typval and the growarray.
This commit is contained in:
@@ -929,6 +929,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
|||||||
if (**arg != ']')
|
if (**arg != ']')
|
||||||
{
|
{
|
||||||
emsg(_(e_missing_matching_bracket_after_dict_key));
|
emsg(_(e_missing_matching_bracket_after_dict_key));
|
||||||
|
clear_tv(&tvkey);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
++*arg;
|
++*arg;
|
||||||
|
@@ -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 */
|
||||||
|
/**/
|
||||||
|
2101,
|
||||||
/**/
|
/**/
|
||||||
2100,
|
2100,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -4392,7 +4392,10 @@ compile_and_or(
|
|||||||
// eval the next expression
|
// eval the next expression
|
||||||
*arg = skipwhite(p + 2);
|
*arg = skipwhite(p + 2);
|
||||||
if (may_get_next_line_error(p + 2, arg, cctx) == FAIL)
|
if (may_get_next_line_error(p + 2, arg, cctx) == FAIL)
|
||||||
|
{
|
||||||
|
ga_clear(&end_ga);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
if ((opchar == '|' ? compile_expr3(arg, cctx, ppconst)
|
if ((opchar == '|' ? compile_expr3(arg, cctx, ppconst)
|
||||||
: compile_expr4(arg, cctx, ppconst)) == FAIL)
|
: compile_expr4(arg, cctx, ppconst)) == FAIL)
|
||||||
|
Reference in New Issue
Block a user