mirror of
https://github.com/json-c/json-c.git
synced 2026-11-05 21:20:16 +08:00
Merge pull request #970 from hilbert149/parseit
json_parse: Exit with error when reading the input fails
This commit is contained in:
1 file changed
+2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user