diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-05-24 15:45:29 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-05-24 15:45:29 +0200 |
commit | 15bbb8f4f38d25d491d7dff83ef0552e2d442d5d (patch) | |
tree | 0143d39a489d7ea395f218fad04c9d84a860f0d7 | |
parent | 611728f80604dd56960e8c197e5749d203c8feb1 (diff) | |
download | vim-git-15bbb8f4f38d25d491d7dff83ef0552e2d442d5d.tar.gz |
patch 8.2.2882: Vim9: memory leak when lambda has an errorv8.2.2882
Problem: Vim9: memory leak when lambda has an error.
Solution: Free the list of argument types on failure.
-rw-r--r-- | src/userfunc.c | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index dd6939c9a..f5d906302 100644 --- 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 index 7fb140112..378e846f7 100644 --- 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, |