]> granicus.if.org Git - vim/commitdiff
patch 8.2.1869: Vim9: memory leak when using add() v8.2.1869
authorBram Moolenaar <Bram@vim.org>
Mon, 19 Oct 2020 21:01:46 +0000 (23:01 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 19 Oct 2020 21:01:46 +0000 (23:01 +0200)
Problem:    Vim9: memory leak when using add().
Solution:   Free the added item.

src/version.c
src/vim9execute.c

index 90ab88ab6eebc794f480efcb00a3e543dd277b4c..a0bc13546661220ca861149204a84f3997218f92 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1869,
 /**/
     1868,
 /**/
index 7a5871a7fb9062095ee69f639e28c67030351b2c..115212fdcee7127e19c8bc1f727a62d9f30f07c1 100644 (file)
@@ -2308,6 +2308,7 @@ call_def_function(
                    }
                    if (list_append_tv(l, tv2) == FAIL)
                        goto failed;
+                   clear_tv(tv2);
                    --ectx.ec_stack.ga_len;
                }
                break;