# HG changeset patch # User Bram Moolenaar # Date 1569684603 -7200 # Node ID 2ec4ed3f5e129cc4880ddfbefcd2bc1742018c3b # Parent d953ad50f7e53e8cb13954fb6da7bff45c87e39d patch 8.1.2095: leaking memory when getting item from dict Commit: https://github.com/vim/vim/commit/a893194d91a2942d4d54085d746ed137a9251b69 Author: Bram Moolenaar Date: Sat Sep 28 17:25:10 2019 +0200 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 --- a/src/dict.c +++ b/src/dict.c @@ -822,7 +822,6 @@ dict_get_tv(char_u **arg, typval_T *rett goto failret; } item = dictitem_alloc(key); - clear_tv(&tvkey); if (item != NULL) { item->di_tv = tv; @@ -831,6 +830,7 @@ dict_get_tv(char_u **arg, typval_T *rett dictitem_free(item); } } + clear_tv(&tvkey); if (**arg == '}') break; diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2095, +/**/ 2094, /**/ 2093,