mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -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,
|
types_optional ? &argtypes : NULL, types_optional,
|
||||||
NULL, NULL, TRUE, NULL, NULL);
|
NULL, NULL, TRUE, NULL, NULL);
|
||||||
if (ret == FAIL || skip_arrow(s, equal_arrow) == NULL)
|
if (ret == FAIL || skip_arrow(s, equal_arrow) == NULL)
|
||||||
|
{
|
||||||
|
if (types_optional)
|
||||||
|
ga_clear_strings(&argtypes);
|
||||||
return NOTDONE;
|
return NOTDONE;
|
||||||
|
}
|
||||||
|
|
||||||
// Parse the arguments again.
|
// Parse the arguments again.
|
||||||
if (evaluate)
|
if (evaluate)
|
||||||
@@ -535,7 +539,11 @@ get_lambda_tv(
|
|||||||
types_optional ? &argtypes : NULL, types_optional,
|
types_optional ? &argtypes : NULL, types_optional,
|
||||||
&varargs, NULL, FALSE, NULL, NULL);
|
&varargs, NULL, FALSE, NULL, NULL);
|
||||||
if (ret == FAIL || (*arg = skip_arrow(*arg, equal_arrow)) == NULL)
|
if (ret == FAIL || (*arg = skip_arrow(*arg, equal_arrow)) == NULL)
|
||||||
|
{
|
||||||
|
if (types_optional)
|
||||||
|
ga_clear_strings(&argtypes);
|
||||||
return NOTDONE;
|
return NOTDONE;
|
||||||
|
}
|
||||||
|
|
||||||
// Set up a flag for checking local variables and arguments.
|
// Set up a flag for checking local variables and arguments.
|
||||||
if (evaluate)
|
if (evaluate)
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2205,
|
||||||
/**/
|
/**/
|
||||||
2204,
|
2204,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user