mirror of
https://github.com/json-c/json-c.git
synced 2026-04-12 16:59:06 +08:00
Merge pull request #665 from stoeckmann/tokener
Handle more allocation failures in json_tokener* functions
This commit is contained in:
@@ -134,6 +134,12 @@ struct json_tokener *json_tokener_new_ex(int depth)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
tok->pb = printbuf_new();
|
tok->pb = printbuf_new();
|
||||||
|
if (!tok->pb)
|
||||||
|
{
|
||||||
|
free(tok);
|
||||||
|
free(tok->stack);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
tok->max_depth = depth;
|
tok->max_depth = depth;
|
||||||
json_tokener_reset(tok);
|
json_tokener_reset(tok);
|
||||||
return tok;
|
return tok;
|
||||||
|
|||||||
Reference in New Issue
Block a user