mirror of
https://github.com/json-c/json-c.git
synced 2026-11-05 21:20:16 +08:00
json_parse: Exit with error when reading the input fails
This commit is contained in:
1 parent
befb5a0b26
commit
ea23279b75
1 file changed
+2
@@ -140,6 +140,8 @@ static int parseit(int fd, int (*callback)(struct json_object *))
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "error reading fd %d: %s\n", fd, strerror(errno));
|
fprintf(stderr, "error reading fd %d: %s\n", fd, strerror(errno));
|
||||||
|
json_tokener_free(tok);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
json_tokener_free(tok);
|
json_tokener_free(tok);
|
||||||
|
|||||||
Reference in new issue
Block a user