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)
|
void json_tokener_free(struct json_tokener *tok)
|
||||||
{
|
{
|
||||||
|
if (!tok)
|
||||||
|
return;
|
||||||
json_tokener_reset(tok);
|
json_tokener_reset(tok);
|
||||||
if (tok->pb)
|
if (tok->pb)
|
||||||
printbuf_free(tok->pb);
|
printbuf_free(tok->pb);
|
||||||
|
|||||||
Reference in New Issue
Block a user