mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.2205: Vim9: memory leak when parsing lambda fails
Problem: Vim9: memory leak when parsing lambda fails. Solution: Clear growarrays.
This commit is contained in:
@@ -523,7 +523,11 @@ get_lambda_tv(
|
||||
types_optional ? &argtypes : NULL, types_optional,
|
||||
NULL, NULL, TRUE, NULL, NULL);
|
||||
if (ret == FAIL || skip_arrow(s, equal_arrow) == NULL)
|
||||
{
|
||||
if (types_optional)
|
||||
ga_clear_strings(&argtypes);
|
||||
return NOTDONE;
|
||||
}
|
||||
|
||||
// Parse the arguments again.
|
||||
if (evaluate)
|
||||
@@ -535,7 +539,11 @@ get_lambda_tv(
|
||||
types_optional ? &argtypes : NULL, types_optional,
|
||||
&varargs, NULL, FALSE, NULL, NULL);
|
||||
if (ret == FAIL || (*arg = skip_arrow(*arg, equal_arrow)) == NULL)
|
||||
{
|
||||
if (types_optional)
|
||||
ga_clear_strings(&argtypes);
|
||||
return NOTDONE;
|
||||
}
|
||||
|
||||
// Set up a flag for checking local variables and arguments.
|
||||
if (evaluate)
|
||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2205,
|
||||
/**/
|
||||
2204,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user