0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -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:
Bram Moolenaar
2020-12-06 16:03:55 +01:00
parent 67322bf74a
commit 8bb0f5472c
3 changed files with 6 additions and 0 deletions

View File

@@ -4392,7 +4392,10 @@ compile_and_or(
// eval the next expression
*arg = skipwhite(p + 2);
if (may_get_next_line_error(p + 2, arg, cctx) == FAIL)
{
ga_clear(&end_ga);
return FAIL;
}
if ((opchar == '|' ? compile_expr3(arg, cctx, ppconst)
: compile_expr4(arg, cctx, ppconst)) == FAIL)