]> granicus.if.org Git - vim/commitdiff
patch 8.2.1709: Vim9: memory leak when using multiple closures v8.2.1709
authorBram Moolenaar <Bram@vim.org>
Fri, 18 Sep 2020 21:11:10 +0000 (23:11 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 18 Sep 2020 21:11:10 +0000 (23:11 +0200)
Problem:    Vim9: memory leak when using multiple closures.
Solution:   Free the partial.

src/version.c
src/vim9execute.c

index 2701c79d71cf991428f100c2f48e78beb8fa4947..60aa105995810c37c111a93f0dae0151c0703db8 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1709,
 /**/
     1708,
 /**/
index 5fe587892f2999faa175e0f217e367b9cb498607..e4ccaaa8a11124822425dd70a2ba3ca13c618173 100644 (file)
@@ -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;