diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-09-28 14:52:17 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-10-01 22:27:44 -0400 |
commit | 8b67c8f8c6538f22c6b6868a2603109b6670874e (patch) | |
tree | e6eaec3cf910fd0ef4fecd5531eade033f0656ab /src/nvim/eval.c | |
parent | 74947203afedd0227ee383ce4396745b2d5f6c4f (diff) | |
download | rneovim-8b67c8f8c6538f22c6b6868a2603109b6670874e.tar.gz rneovim-8b67c8f8c6538f22c6b6868a2603109b6670874e.tar.bz2 rneovim-8b67c8f8c6538f22c6b6868a2603109b6670874e.zip |
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
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |