summaryrefslogtreecommitdiffstats
path: root/src/option.c
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 /src/option.c
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".
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c2
1 files changed, 1 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