diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-29 21:11:30 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-29 21:11:30 +0200 |
commit | 77111e2bfc7316eb6b1e653386cef6441af806f8 (patch) | |
tree | c18b172c37a824e31fe89560ea47e36f62f7b5f7 | |
parent | 131530a54d0f72b820b027606231744e3a09b9ef (diff) | |
download | vim-git-77111e2bfc7316eb6b1e653386cef6441af806f8.tar.gz |
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.c | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/option.c b/src/option.c index 182ff341c..decba501a 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 6b372008c..7710018b3 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, |