mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(coverity/188749): nullify pointer to fix use-after-free
This commit is contained in:
parent
e850a92986
commit
d224957d30
@ -4351,7 +4351,7 @@ int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use
|
||||
// Only free the string buffer if we allocated it.
|
||||
// Note: This is not needed if `str` is pointing at `tmp`
|
||||
if (opt == STL_VIM_EXPR) {
|
||||
xfree(str);
|
||||
XFREE_CLEAR(str);
|
||||
}
|
||||
|
||||
if (num >= 0 || (!itemisflag && str && *str)) {
|
||||
|
Loading…
Reference in New Issue
Block a user