]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2: Be sure to have a connection to unsubcribe
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 18 Sep 2019 09:07:20 +0000 (11:07 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 18 Sep 2019 09:20:55 +0000 (11:20 +0200)
When the mux is released, It must own the connection to unsubcribe.
This patch must be backported to 2.0.

src/mux_h2.c

index fababa19030557de775aff66284a28db77c6c18a..00c8968f9e243a83ddbe2b3e28e2705b041000f6 100644 (file)
@@ -923,9 +923,9 @@ static void h2_release(struct h2c *h2c)
                }
                if (h2c->wait_event.tasklet)
                        tasklet_free(h2c->wait_event.tasklet);
-               if (h2c->wait_event.events != 0)
+               if (conn && h2c->wait_event.events != 0)
                        conn->xprt->unsubscribe(conn, conn->xprt_ctx, h2c->wait_event.events,
-                           &h2c->wait_event);
+                                               &h2c->wait_event);
 
                pool_free(pool_head_h2c, h2c);
        }