From 67df95a8a2a0f64c7faeab85efe0fd2fbfebd8f6 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 14 Apr 2022 12:02:34 +0200 Subject: [PATCH] BUILD: http-client: Avoid dead code when compiled without SSL support When an HTTP client is started on an HAProxy compiled without the SSL support, an error is triggered when HTTPS is used. In this case, the freshly created conn-stream is released. But this code is specific to the non-SSL part. Thus it is moved the in right #if/#else section. This patch should fix the issue #1655. --- src/http_client.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/http_client.c b/src/http_client.c index 23b8dc89a4..f1e5345a65 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -519,7 +519,11 @@ struct appctx *httpclient_start(struct httpclient *hc) s->target = &httpclient_srv_ssl->obj_type; #else ha_alert("httpclient: OpenSSL is not available %s:%d.\n", __FUNCTION__, __LINE__); - goto out_free_stream; + cs_detach_app(cs); + LIST_DELETE(&s->list); + pool_free(pool_head_stream, s); + cs_free(cs); + goto out_free_addr; #endif break; } @@ -544,11 +548,6 @@ struct appctx *httpclient_start(struct httpclient *hc) return appctx; -out_free_stream: - cs_detach_app(cs); - LIST_DELETE(&s->list); - pool_free(pool_head_stream, s); - cs_free(cs); out_free_addr: sockaddr_free(&addr); out_free_sess: -- 2.47.3