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;
diff --git a/src/version.c b/src/version.c
index 369807a..32ddda8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2095,
+/**/
2094,
/**/
2093,