diff --git a/src/flb_utils.c b/src/flb_utils.c index ac876175a56..d0864d4d9f1 100644 --- a/src/flb_utils.c +++ b/src/flb_utils.c @@ -1303,7 +1303,9 @@ int flb_utils_read_file(char *path, char **out_buf, size_t *out_size) bytes = fread(buf, st.st_size, 1, fp); if (bytes < 1) { - flb_errno(); + if (bytes < 0) { + flb_errno(); + } flb_free(buf); fclose(fp); return -1;