mirror of
https://github.com/json-c/json-c.git
synced 2026-03-25 07:59:07 +08:00
Merge pull request #879 from janotomko/null
Handle NULL gracefully in json_tokener_free
This commit is contained in:
@@ -185,6 +185,8 @@ struct json_tokener *json_tokener_new(void)
|
||||
|
||||
void json_tokener_free(struct json_tokener *tok)
|
||||
{
|
||||
if (!tok)
|
||||
return;
|
||||
json_tokener_reset(tok);
|
||||
if (tok->pb)
|
||||
printbuf_free(tok->pb);
|
||||
|
||||
Reference in New Issue
Block a user