From 5d51473810ea125b82d4e5b4668df76830ad5ede Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Thu, 22 Jul 2021 18:31:21 +0000 Subject: [PATCH] http_client: log allocation failures for request headers 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 --- src/flb_http_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/flb_http_client.c b/src/flb_http_client.c index 09398d88434..110cc69e7d8 100644 --- a/src/flb_http_client.c +++ b/src/flb_http_client.c @@ -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;