# HG changeset patch # User Bram Moolenaar # Date 1600880404 -7200 # Node ID 62192fd08e0ea126c81c270aa85df95303cb3c3f # Parent 79a8725302018b87dde2951f01d751589a57779a patch 8.2.1733: Vim9: memory leaks when using nested function Commit: https://github.com/vim/vim/commit/4ee711f21389066fa157961feed17692fc16bf8e Author: Bram Moolenaar Date: Wed Sep 23 18:51:11 2020 +0200 patch 8.2.1733: Vim9: memory leaks when using nested function Problem: Vim9: memory leaks when using nested function. Solution: Free function when compilation fails. 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 */ /**/ + 1733, +/**/ 1732, /**/ 1731, diff --git a/src/vim9compile.c b/src/vim9compile.c --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -4408,7 +4408,10 @@ compile_nested_function(exarg_T *eap, cc return eap->skip ? (char_u *)"" : NULL; if (ufunc->uf_def_status == UF_TO_BE_COMPILED && compile_def_function(ufunc, TRUE, cctx) == FAIL) + { + func_ptr_unref(ufunc); return NULL; + } if (is_global) {