Skip to content

Commit 961c31f

Browse files
authored
Merge pull request json-c#879 from janotomko/null
Handle NULL gracefully in json_tokener_free
2 parents c63d4a4 + 828c12b commit 961c31f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

json_tokener.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ struct json_tokener *json_tokener_new(void)
185185

186186
void json_tokener_free(struct json_tokener *tok)
187187
{
188+
if (!tok)
189+
return;
188190
json_tokener_reset(tok);
189191
if (tok->pb)
190192
printbuf_free(tok->pb);

0 commit comments

Comments
 (0)