fix(coverity/188749): nullify pointer to fix use-after-free

This commit is contained in:
James McCoy 2022-01-19 22:07:37 -05:00
parent e850a92986
commit d224957d30
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

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