Browse Source
Merge pull request #665 from stoeckmann/tokener
Handle more allocation failures in json_tokener* functions
tags/json-c-0.16-20220414
Eric Hawicz
GitHub
5 years ago
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
0 deletions
-
json_tokener.c
|
|
@@ -134,6 +134,12 @@ struct json_tokener *json_tokener_new_ex(int depth) |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
tok->pb = printbuf_new(); |
|
|
|
if (!tok->pb) |
|
|
|
{ |
|
|
|
free(tok); |
|
|
|
free(tok->stack); |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
tok->max_depth = depth; |
|
|
|
json_tokener_reset(tok); |
|
|
|
return tok; |
|
|
|