From: Bram Moolenaar Date: Sat, 28 Sep 2019 15:25:10 +0000 (+0200) Subject: patch 8.1.2095: leaking memory when getting item from dict X-Git-Tag: v8.1.2095 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a893194d91a2942d4d54085d746ed137a9251b69;p=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. --- diff --git a/src/dict.c b/src/dict.c index 649a7da71..d26356928 100644 --- a/src/dict.c +++ b/src/dict.c @@ -822,7 +822,6 @@ dict_get_tv(char_u **arg, typval_T *rettv, int evaluate, int literal) 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 *rettv, int evaluate, int literal) dictitem_free(item); } } + clear_tv(&tvkey); if (**arg == '}') break; diff --git a/src/version.c b/src/version.c index 369807aa5..32ddda81b 100644 --- a/src/version.c +++ b/src/version.c @@ -757,6 +757,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2095, /**/ 2094, /**/