From 8bb0f5472c740458708fd3edabbb8d5193a96241 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 6 Dec 2020 16:03:55 +0100 Subject: 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. --- src/dict.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/dict.c') diff --git a/src/dict.c b/src/dict.c index 311b0038d1..5581a5571b 100644 --- a/src/dict.c +++ b/src/dict.c @@ -929,6 +929,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal) if (**arg != ']') { emsg(_(e_missing_matching_bracket_after_dict_key)); + clear_tv(&tvkey); return FAIL; } ++*arg; -- cgit v1.2.3