0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3246: memory use after free

Problem:    Memory use after free.
Solution:   When clearing a string option set the pointer to "empty_option".
This commit is contained in:
Bram Moolenaar
2021-07-29 21:11:30 +02:00
parent 131530a54d
commit 77111e2bfc
2 changed files with 3 additions and 1 deletions

View File

@@ -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