# HG changeset patch # User Bram Moolenaar # Date 1621864804 -7200 # Node ID 0668fe755d2b2312b83701b27bf7e1b4d08b5d34 # Parent b839c305dfa65cc38337fd321fd6a3a0be19652e patch 8.2.2882: Vim9: memory leak when lambda has an error Commit: https://github.com/vim/vim/commit/15bbb8f4f38d25d491d7dff83ef0552e2d442d5d Author: Bram Moolenaar Date: Mon May 24 15:45:29 2021 +0200 patch 8.2.2882: Vim9: memory leak when lambda has an error Problem: Vim9: memory leak when lambda has an error. Solution: Free the list of argument types on failure. diff --git a/src/userfunc.c b/src/userfunc.c --- a/src/userfunc.c +++ b/src/userfunc.c @@ -1394,7 +1394,11 @@ errret: ga_clear_strings(&newlines); ga_clear_strings(&default_args); if (types_optional) + { ga_clear_strings(&argtypes); + if (fp != NULL) + vim_free(fp->uf_arg_types); + } vim_free(fp); vim_free(pt); if (evalarg != NULL && evalarg->eval_tofree == NULL) 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 */ /**/ + 2882, +/**/ 2881, /**/ 2880,