patch 8.2.1869: Vim9: memory leak when using add()
Problem: Vim9: memory leak when using add().
Solution: Free the added item.
diff --git a/src/version.c b/src/version.c
index 90ab88a..a0bc135 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1869,
+/**/
1868,
/**/
1867,
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 7a5871a..115212f 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -2308,6 +2308,7 @@
}
if (list_append_tv(l, tv2) == FAIL)
goto failed;
+ clear_tv(tv2);
--ectx.ec_stack.ga_len;
}
break;