Skip to content

Commit 15bbb8f

Browse files
committed
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.
1 parent 611728f commit 15bbb8f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/userfunc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,11 @@ get_lambda_tv(
13941394
ga_clear_strings(&newlines);
13951395
ga_clear_strings(&default_args);
13961396
if (types_optional)
1397+
{
13971398
ga_clear_strings(&argtypes);
1399+
if (fp != NULL)
1400+
vim_free(fp->uf_arg_types);
1401+
}
13981402
vim_free(fp);
13991403
vim_free(pt);
14001404
if (evalarg != NULL && evalarg->eval_tofree == NULL)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2882,
753755
/**/
754756
2881,
755757
/**/

0 commit comments

Comments
 (0)