From 2f8303702edd567518b521d5f7a5a0863d3c6db2 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Fri, 17 Oct 2025 15:08:07 +0900 Subject: [PATCH] out_http: Plug a NULL dereference Signed-off-by: Hiroshi Hatake --- plugins/out_http/http.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/out_http/http.c b/plugins/out_http/http.c index 88b62673742..1c912989081 100644 --- a/plugins/out_http/http.c +++ b/plugins/out_http/http.c @@ -178,6 +178,18 @@ static int http_post(struct flb_out_http *ctx, ctx->host, ctx->port, ctx->proxy, 0); + if (c == NULL) { + flb_plg_error(ctx->ins, "[http_client] failed to create HTTP client"); + if (payload_buf != body) { + flb_free(payload_buf); + } + + if (u_conn) { + flb_upstream_conn_release(u_conn); + } + + return FLB_RETRY; + } if (c->proxy.host) { flb_plg_debug(ctx->ins, "[http_client] proxy host: %s port: %i",