mirror of
https://github.com/json-c/json-c.git
synced 2026-04-08 14:59:06 +08:00
Merge pull request #722 from imaami/fix-json_tokener_new_ex-use-after-free
Fix use-after-free in json_tokener_new_ex()
This commit is contained in:
@@ -164,8 +164,8 @@ struct json_tokener *json_tokener_new_ex(int depth)
|
|||||||
tok->pb = printbuf_new();
|
tok->pb = printbuf_new();
|
||||||
if (!tok->pb)
|
if (!tok->pb)
|
||||||
{
|
{
|
||||||
free(tok);
|
|
||||||
free(tok->stack);
|
free(tok->stack);
|
||||||
|
free(tok);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
tok->max_depth = depth;
|
tok->max_depth = depth;
|
||||||
|
|||||||
Reference in New Issue
Block a user