diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-12-28 20:18:50 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-28 20:18:50 +0000 |
commit | 8c697e3698e7dbe0a3c4524ac360b78ceb852b23 (patch) | |
tree | f73537be5ed996f564bb468fb2cf95a2a89a8656 | |
parent | 92f246e4f9936f15471d5ee71b9afd5f3e6e0653 (diff) |
patch 8.2.3927: Vim9: double free when using lambdav8.2.3927
Problem: Vim9: double free when using lambda.
Solution: Don't free both cmdline and line_to_free.
-rw-r--r-- | src/userfunc.c | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index b87cdedb68..c894c5896e 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -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; } diff --git a/src/version.c b/src/version.c index e091971833..4d8110510a 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3927, +/**/ 3926, /**/ 3925, |