From 955347cc7e78352a5d49540573ae958ad45e6386 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 19 Oct 2020 23:01:46 +0200 Subject: [PATCH] patch 8.2.1869: Vim9: memory leak when using add() Problem: Vim9: memory leak when using add(). Solution: Free the added item. --- src/version.c | 2 ++ src/vim9execute.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/version.c b/src/version.c index 90ab88ab6..a0bc13546 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 7a5871a7f..115212fdc 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;