diff --git a/apps/json_parse.c b/apps/json_parse.c index ebb0f25..f1222fe 100644 --- a/apps/json_parse.c +++ b/apps/json_parse.c @@ -140,6 +140,8 @@ static int parseit(int fd, int (*callback)(struct json_object *)) if (ret < 0) { fprintf(stderr, "error reading fd %d: %s\n", fd, strerror(errno)); + json_tokener_free(tok); + return 1; } json_tokener_free(tok);