mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
vim-patch:8.1.2091: double free when memory allocation fails
Problem: Double free when memory allocation fails. (Zu-Ming Jiang)
Solution: Use VIM_CLEAR() instead of vim_free(). (closes vim/vim#4991)
0f1c6708fd
This commit is contained in:
@@ -1165,12 +1165,12 @@ void free_typebuf(void)
|
||||
if (typebuf.tb_buf == typebuf_init) {
|
||||
internal_error("Free typebuf 1");
|
||||
} else {
|
||||
xfree(typebuf.tb_buf);
|
||||
XFREE_CLEAR(typebuf.tb_buf);
|
||||
}
|
||||
if (typebuf.tb_noremap == noremapbuf_init) {
|
||||
internal_error("Free typebuf 2");
|
||||
} else {
|
||||
xfree(typebuf.tb_noremap);
|
||||
XFREE_CLEAR(typebuf.tb_noremap);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user