Fix issue #854: Set error=json_tokener_error_memory in json_tokener_parser_verbose() when allocating the tokener fails.

This commit is contained in:
Eric Hawicz
2024-03-29 18:09:12 -04:00
parent 0bc2dd5e60
commit e93ae70417

View File

@@ -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