From dec07510bbdf335a2de3d63591231a90ef3e4c80 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 18 Sep 2020 23:11:10 +0200 Subject: [PATCH] patch 8.2.1709: Vim9: memory leak when using multiple closures Problem: Vim9: memory leak when using multiple closures. Solution: Free the partial. --- src/version.c | 2 ++ src/vim9execute.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/version.c b/src/version.c index 2701c79d71..60aa105995 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 */ +/**/ + 1709, /**/ 1708, /**/ diff --git a/src/vim9execute.c b/src/vim9execute.c index 5fe587892f..e4ccaaa8a1 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -1830,6 +1830,7 @@ call_def_function( // TODO: use a garray_T on ectx. SOURCING_LNUM = iptr->isn_lnum; emsg("Multiple closures not supported yet"); + vim_free(pt); goto failed; } tv->v_type = VAR_PARTIAL;