]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux_pt: Don't forget to unsubscribe() on attach.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 29 Nov 2018 12:49:59 +0000 (13:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 29 Nov 2018 12:52:31 +0000 (13:52 +0100)
In the mux_pt, when we're attaching a new conn_stream, don't forget to
unsubscribe from the connection. Failure to do so may lead to the mux_pt
freeing the connection while the conn_stream can still want to access it.

src/mux_pt.c

index 5a80848bec96fd80ece38c33c0057e1cb0a0a898..1f0f3e5a0df7c9ad933be711c8734855f7ff7aa2 100644 (file)
@@ -142,6 +142,7 @@ static struct conn_stream *mux_pt_attach(struct connection *conn)
        struct conn_stream *cs;
        struct mux_pt_ctx *ctx = conn->mux_ctx;
 
+       conn->xprt->unsubscribe(conn, SUB_CAN_RECV, &ctx->wait_event);
        cs = cs_new(conn);
        if (!cs)
                goto fail;