0
0
mirror of https://github.com/vim/vim.git synced 2025-09-07 22:03:36 -04:00

patch 8.2.3927: Vim9: double free when using lambda

Problem:    Vim9: double free when using lambda.
Solution:   Don't free both cmdline and line_to_free.
This commit is contained in:
Bram Moolenaar 2021-12-28 20:18:50 +00:00
parent 92f246e4f9
commit 8c697e3698
2 changed files with 4 additions and 1 deletions

View File

@ -1146,7 +1146,8 @@ lambda_function_body(
ga_init2(&newlines, (int)sizeof(char_u *), 10);
if (get_function_body(&eap, &newlines, NULL, &line_to_free) == FAIL)
{
vim_free(cmdline);
if (cmdline != line_to_free)
vim_free(cmdline);
goto erret;
}

View File

@ -749,6 +749,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3927,
/**/
3926,
/**/