From: Amaury Denoyelle Date: Fri, 5 Mar 2021 14:27:41 +0000 (+0100) Subject: MINOR: backend: add a BUG_ON if conn mux NULL in connect_server X-Git-Tag: v2.4-dev11~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7faa3d6e9626e644d43709b79803b80696cbf89;p=thirdparty%2Fhaproxy.git MINOR: backend: add a BUG_ON if conn mux NULL in connect_server Currently, there seems to be no way to have the transport layer ready but not the mux in the function connect_server. Add a BUG_ON to report if this implicit condition is not true anymore. This should fix coverity report from github issue #1120. --- diff --git a/src/backend.c b/src/backend.c index 66fa5ea37a..15bab2291a 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1585,6 +1585,11 @@ skip_reuse: srv_conn->mux->reset(srv_conn); } else { + /* Currently there seems to be no known cases of xprt ready + * without the mux installed here. + */ + BUG_ON(!srv_conn->mux); + /* Only consider we're doing reuse if the connection was * ready. */