changeset 18201:2ec4ed3f5e12 v8.1.2095

patch 8.1.2095: leaking memory when getting item from dict Commit: https://github.com/vim/vim/commit/a893194d91a2942d4d54085d746ed137a9251b69 Author: Bram Moolenaar <Bram@vim.org> 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.
author Bram Moolenaar <Bram@vim.org>
date Sat, 28 Sep 2019 17:30:03 +0200
parents d953ad50f7e5
children 13049de86673
files src/dict.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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,