Skip to content

Commit

Permalink
http_client: log allocation failures for request headers
Browse files Browse the repository at this point in the history
Calls to flb_realloc() normally log allocation failures with
flb_errno(). This commit adds this missing logging.

This should help disambiguate errors in flb_http_do() that are due to
memory issues as opposed to HTTP-level issues.

Signed-off-by: Aaron Jacobs <[email protected]>
  • Loading branch information
atheriel authored and nokute78 committed Jul 24, 2021
1 parent 655e17d commit 5d51473
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/flb_http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@ int flb_http_do(struct flb_http_client *c, size_t *bytes)
new_size = c->header_size + 2;
tmp = flb_realloc(c->header_buf, new_size);
if (!tmp) {
flb_errno();
return -1;
}
c->header_buf = tmp;
Expand Down

0 comments on commit 5d51473

Please sign in to comment.