summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-07-29 21:11:30 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-29 21:11:30 +0200
commit77111e2bfc7316eb6b1e653386cef6441af806f8 (patch)
treec18b172c37a824e31fe89560ea47e36f62f7b5f7
parent131530a54d0f72b820b027606231744e3a09b9ef (diff)
patch 8.2.3246: memory use after freev8.2.3246
Problem: Memory use after free. Solution: When clearing a string option set the pointer to "empty_option".
-rw-r--r--src/option.c2
-rw-r--r--src/version.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/option.c b/src/option.c
index 182ff341cf..decba501a9 100644
--- a/src/option.c
+++ b/src/option.c
@@ -807,7 +807,7 @@ free_all_options(void)
else if (options[i].var != VAR_WIN
&& (options[i].flags & P_STRING))
// buffer-local option: free global value
- free_string_option(*(char_u **)options[i].var);
+ clear_string_option((char_u **)options[i].var);
}
}
#endif
diff --git a/src/version.c b/src/version.c
index 6b372008c5..7710018b31 100644
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3246,
+/**/
3245,
/**/
3244,