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.
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 3faf5ae..4a2d864 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -491,6 +491,19 @@
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);
}