From 251f6a23add725cc60837ce8f19fdfac75f963f4 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Wed, 12 Sep 2018 17:52:46 +0200 Subject: [PATCH] BUG/MEDIUM: h2: Don't forget to empty the wait lists on destroy. Empty both send_list and fctl_list when destroying the h2 context, so that if we're freeing the stream after, it doesn't try to remove itself from the now-deleted list. No backport is needed. --- src/mux_h2.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mux_h2.c b/src/mux_h2.c index 3faf5aeef..4a2d864e4 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -491,6 +491,19 @@ static void h2_release(struct connection *conn) tasklet_free(h2c->wait_list.task); LIST_DEL(&h2c->wait_list.list); LIST_INIT(&h2c->wait_list.list); + while (!LIST_ISEMPTY(&h2c->send_list)) { + struct wait_list *sw = LIST_ELEM(h2c->send_list.n, + struct wait_list *, list); + LIST_DEL(&sw->list); + LIST_INIT(&sw->list); + } + while (!LIST_ISEMPTY(&h2c->fctl_list)) { + struct wait_list *sw = LIST_ELEM(h2c->fctl_list.n, + struct wait_list *, list); + LIST_DEL(&sw->list); + LIST_INIT(&sw->list); + } + pool_free(pool_head_h2c, h2c); }