From 8b67c8f8c6538f22c6b6868a2603109b6670874e Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 28 Sep 2019 14:52:17 -0400 Subject: vim-patch:8.1.2095: leaking memory when getting item from dict Problem: Leaking memory when getting item from dict. Solution: Also free the key when not evaluating. https://github.com/vim/vim/commit/a893194d91a2942d4d54085d746ed137a9251b69 --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index cb1dd1d631..e3e5bb9a90 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -5746,13 +5746,13 @@ static int dict_get_tv(char_u **arg, typval_T *rettv, int evaluate) goto failret; } item = tv_dict_item_alloc((const char *)key); - tv_clear(&tvkey); item->di_tv = tv; item->di_tv.v_lock = 0; if (tv_dict_add(d, item) == FAIL) { tv_dict_item_free(item); } } + tv_clear(&tvkey); if (**arg == '}') break; -- cgit