0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -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,6 +1146,7 @@ lambda_function_body(
ga_init2(&newlines, (int)sizeof(char_u *), 10); ga_init2(&newlines, (int)sizeof(char_u *), 10);
if (get_function_body(&eap, &newlines, NULL, &line_to_free) == FAIL) if (get_function_body(&eap, &newlines, NULL, &line_to_free) == FAIL)
{ {
if (cmdline != line_to_free)
vim_free(cmdline); vim_free(cmdline);
goto erret; goto erret;
} }

View File

@@ -749,6 +749,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 */
/**/
3927,
/**/ /**/
3926, 3926,
/**/ /**/