From d6b1d5f6e9a0577e06fc17e9162db98b042e601b Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 15 Dec 2025 08:01:20 +0100 Subject: [PATCH] CLEANUP: tcpcheck: Remove useless test on the xprt used for healthchecks The xprt used to perform a healthcheck 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/tcpcheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tcpcheck.c b/src/tcpcheck.c index 28cdd94f2..f307c814b 100644 --- a/src/tcpcheck.c +++ b/src/tcpcheck.c @@ -1462,7 +1462,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_connect(struct check *check, struct tcpchec : ((connect->options & TCPCHK_OPT_DEFAULT_CONNECT) ? check->xprt : xprt_get(XPRT_RAW))); #ifdef USE_OPENSSL - if (xprt && xprt->get_ssl_sock_ctx) { + if (xprt->get_ssl_sock_ctx) { if (connect->sni) sni = ist(connect->sni); else if ((connect->options & TCPCHK_OPT_DEFAULT_CONNECT) && s && s->check.sni)