forked from aniani/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 #4991)
This commit is contained in:
@@ -1296,11 +1296,11 @@ free_typebuf(void)
|
|||||||
if (typebuf.tb_buf == typebuf_init)
|
if (typebuf.tb_buf == typebuf_init)
|
||||||
internal_error("Free typebuf 1");
|
internal_error("Free typebuf 1");
|
||||||
else
|
else
|
||||||
vim_free(typebuf.tb_buf);
|
VIM_CLEAR(typebuf.tb_buf);
|
||||||
if (typebuf.tb_noremap == noremapbuf_init)
|
if (typebuf.tb_noremap == noremapbuf_init)
|
||||||
internal_error("Free typebuf 2");
|
internal_error("Free typebuf 2");
|
||||||
else
|
else
|
||||||
vim_free(typebuf.tb_noremap);
|
VIM_CLEAR(typebuf.tb_noremap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -757,6 +757,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2091,
|
||||||
/**/
|
/**/
|
||||||
2090,
|
2090,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user