# HG changeset patch # User Bram Moolenaar # Date 1603142103 -7200 # Node ID 6dce588f7a46688d18b0d17f5abbe542746d1c06 # Parent e2a0b8084d587a5486f02cf8490a7184cfd0e53d patch 8.2.1869: Vim9: memory leak when using add() Commit: https://github.com/vim/vim/commit/955347cc7e78352a5d49540573ae958ad45e6386 Author: Bram Moolenaar Date: Mon Oct 19 23:01:46 2020 +0200 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 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1869, +/**/ 1868, /**/ 1867, diff --git a/src/vim9execute.c b/src/vim9execute.c --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -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;