]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: backend: Remove useless test on server's xprt
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 15 Dec 2025 06:56:52 +0000 (07:56 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 15 Dec 2025 06:56:53 +0000 (07:56 +0100)
The server's xprt is always defined and cannot be NULL. So there is no
reason to test it. It could lead to wrong assumptions later in the code.

This patch should fix a Coverity report from #3213.

src/backend.c

index 9722b71b9a78db56aba7a121081a36dbde75b026..34ec96711702fcfcdfb0c740728ed8f97ce5702e 100644 (file)
@@ -2042,7 +2042,7 @@ int connect_server(struct stream *s)
                        struct ist sni = IST_NULL;
 
                        /* Set socket SNI */
-                       if (srv->xprt && srv->xprt->get_ssl_sock_ctx && srv->ssl_ctx.sni) {
+                       if (srv->xprt->get_ssl_sock_ctx && srv->ssl_ctx.sni) {
                                sni_smp = sample_fetch_as_type(s->be, s->sess, s,
                                                               SMP_OPT_DIR_REQ | SMP_OPT_FINAL,
                                                               srv->ssl_ctx.sni, SMP_T_STR);