commit | a893194d91a2942d4d54085d746ed137a9251b69 | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Sat Sep 28 17:25:10 2019 +0200 |
committer | Bram Moolenaar <Bram@vim.org> | Sat Sep 28 17:25:10 2019 +0200 |
tree | 970558778b2b136d434a8d5c43994f9399c7a5e9 | |
parent | 473952e85286eb9c6098801f1819981ba61ad153 [diff] [blame] |
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.
diff --git a/src/dict.c b/src/dict.c index 649a7da..d263569 100644 --- a/src/dict.c +++ b/src/dict.c
@@ -822,7 +822,6 @@ goto failret; } item = dictitem_alloc(key); - clear_tv(&tvkey); if (item != NULL) { item->di_tv = tv; @@ -831,6 +830,7 @@ dictitem_free(item); } } + clear_tv(&tvkey); if (**arg == '}') break;