mirror of
https://github.com/json-c/json-c.git
synced 2026-03-20 21:49: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();
|
||||
if (!tok)
|
||||
{
|
||||
*error = json_tokener_error_memory;
|
||||
return NULL;
|
||||
}
|
||||
obj = json_tokener_parse_ex(tok, str, -1);
|
||||
*error = tok->err;
|
||||
if (tok->err != json_tokener_success
|
||||
|
||||
Reference in New Issue
Block a user