Browse Source

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

tags/json-c-0.18-20240915
Eric Hawicz 1 year ago
parent
commit
e93ae70417
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      json_tokener.c

+ 3
- 0
json_tokener.c 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


Loading…
Cancel
Save