From: Christopher Faulet Date: Thu, 14 Apr 2022 10:02:34 +0000 (+0200) Subject: BUILD: http-client: Avoid dead code when compiled without SSL support X-Git-Tag: v2.6-dev6~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=67df95a8a2a0f64c7faeab85efe0fd2fbfebd8f6;p=thirdparty%2Fhaproxy.git 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. --- 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: