From: Bram Moolenaar Date: Mon, 19 Oct 2020 21:01:46 +0000 (+0200) Subject: patch 8.2.1869: Vim9: memory leak when using add() X-Git-Tag: v8.2.1869 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=955347cc7e78352a5d49540573ae958ad45e6386;p=thirdparty%2Fvim.git 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 90ab88ab6e..a0bc135466 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1869, /**/ 1868, /**/ diff --git a/src/vim9execute.c b/src/vim9execute.c index 7a5871a7fb..115212fdce 100644 --- 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;