mirror of
https://github.com/json-c/json-c.git
synced 2026-04-04 12:59:07 +08:00
Fix issue #854: Set error=json_tokener_error_memory in json_tokener_parser_verbose() when allocating the tokener fails.
This commit is contained in:
@@ -226,7 +226,10 @@ struct json_object *json_tokener_parse_verbose(const char *str, enum json_tokene
|
|||||||
|
|
||||||
tok = json_tokener_new();
|
tok = json_tokener_new();
|
||||||
if (!tok)
|
if (!tok)
|
||||||
|
{
|
||||||
|
*error = json_tokener_error_memory;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
obj = json_tokener_parse_ex(tok, str, -1);
|
obj = json_tokener_parse_ex(tok, str, -1);
|
||||||
*error = tok->err;
|
*error = tok->err;
|
||||||
if (tok->err != json_tokener_success
|
if (tok->err != json_tokener_success
|
||||||
|
|||||||
Reference in New Issue
Block a user