From: Olivier Houchard Date: Tue, 29 Jan 2019 18:00:33 +0000 (+0100) Subject: BUG/MEDIUM: peers: Handle mux creation failure. X-Git-Tag: v2.0-dev1~117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef60ff38fb55d0a2a0eaaadd23945755258cf609;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: peers: Handle mux creation failure. If the mux fails to properly be created by conn_install_mux, fail, instead of silently ignoring it. This should be backported to 1.9. --- diff --git a/src/peers.c b/src/peers.c index bca56aa1d4..30cf94277d 100644 --- a/src/peers.c +++ b/src/peers.c @@ -2314,7 +2314,8 @@ static struct appctx *peer_session_create(struct peers *peers, struct peer *peer memcpy(&conn->addr.to, &peer->addr, sizeof(conn->addr.to)); conn_prepare(conn, peer->proto, peer_xprt(peer)); - conn_install_mux(conn, &mux_pt_ops, cs, s->be, NULL); + if (conn_install_mux(conn, &mux_pt_ops, cs, s->be, NULL) < 0) + goto out_free_cs; si_attach_cs(&s->si[1], cs); s->do_log = NULL; @@ -2328,6 +2329,8 @@ static struct appctx *peer_session_create(struct peers *peers, struct peer *peer return appctx; /* Error unrolling */ +out_free_cs: + cs_free(cs); out_free_conn: conn_free(conn); out_free_strm: