Skip to content

Commit

Permalink
http_client: validate errno before printing the message
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Jan 8, 2021
1 parent 2cc50ba commit dae2967
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/flb_http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,10 @@ int flb_http_do(struct flb_http_client *c, size_t *bytes)
c->header_buf, c->header_len,
&bytes_header);
if (ret == -1) {
flb_errno();
/* errno might be changed from the original call */
if (errno != 0) {
flb_errno();
}
return -1;
}

Expand Down

0 comments on commit dae2967

Please sign in to comment.