summaryrefslogtreecommitdiffstats
path: root/src/dict.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-06 16:03:55 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-06 16:03:55 +0100
commit8bb0f5472c740458708fd3edabbb8d5193a96241 (patch)
treeb21ab779e1502e16c2275d0fe9ec120c561a3279 /src/dict.c
parent67322bf74a106b6476b093e75da87d61e2181b76 (diff)
patch 8.2.2101: Vim9: memory leak when literal dict has an errorv8.2.2101
Problem: Vim9: memory leak when literal dict has an error and when an expression is not complete. Solution: Clear the typval and the growarray.
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c1
1 files changed, 1 insertions, 0 deletions
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;