From: Christopher Faulet Date: Mon, 18 May 2026 12:56:20 +0000 (+0200) Subject: BUG/MINOR: httpclient-cli: Destroy http-client context if failing to start it X-Git-Tag: v3.4-dev13~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c53256adbc17bb76840fdc8213cf8854454d850b;p=thirdparty%2Fhaproxy.git BUG/MINOR: httpclient-cli: Destroy http-client context if failing to start it When the call to httpclient_start() failed, it is the caller responsibilty to destroy the http-client context by calling httpclient_destroy(). It is performed at several places but it was missing in the httpclient_cli code. So let's fix it. This patch must be backported as far as 2.6. On 3.2 and lower, it must be applied on http_client.c. --- diff --git a/src/httpclient_cli.c b/src/httpclient_cli.c index 16a851dd1..8dfa72d9b 100644 --- a/src/httpclient_cli.c +++ b/src/httpclient_cli.c @@ -159,6 +159,7 @@ static int hc_cli_parse(char **args, char *payload, struct appctx *appctx, void err: memprintf(&err, "Can't start the HTTP client%s.\n", err ? err : ""); + httpclient_destroy(hc); return cli_err(appctx, err); }