From 1ced485b29d6afad53d390542ba4afed5fd5a7aa Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Thu, 29 Nov 2018 13:49:59 +0100 Subject: [PATCH] BUG/MEDIUM: mux_pt: Don't forget to unsubscribe() on attach. 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mux_pt.c b/src/mux_pt.c index 5a80848be..1f0f3e5a0 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -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;