diff options
author | James McCoy <jamessan@jamessan.com> | 2022-01-19 22:07:37 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2022-01-19 22:47:09 -0500 |
commit | d224957d30654dfa7fac7732b81f6a1b495a418b (patch) | |
tree | 1d042db30655dc27839218b37f7ef9b7117e44fa /src/nvim/buffer.c | |
parent | e850a929864508864ee52abcbac9579a6a2d2f28 (diff) | |
download | rneovim-d224957d30654dfa7fac7732b81f6a1b495a418b.tar.gz rneovim-d224957d30654dfa7fac7732b81f6a1b495a418b.tar.bz2 rneovim-d224957d30654dfa7fac7732b81f6a1b495a418b.zip |
fix(coverity/188749): nullify pointer to fix use-after-free
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index abd22fba26..0248d42f58 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -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)) { |