BUG/MINOR: fix memleak on quic-conn streams cleaning
When freeing a quic-conn, the streams resources attached to it must be
cleared. This code is already implemented but the streams buffer was not
deallocated.
Fix this by using the function qc_stream_desc_free. This existing
function centralize all operations to properly free all streams
elements, attached both to the MUX and the quic-conn.
This fixes a memory leak which can happen for each released connection.
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 8757d9d..65414fd 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -3808,8 +3808,11 @@
stream = eb64_entry(node, struct qc_stream_desc, by_id);
node = eb64_next(node);
- eb64_delete(&stream->by_id);
- pool_free(pool_head_quic_conn_stream, stream);
+ /* all streams attached to the quic-conn are released, so
+ * qc_stream_desc_free will liberate the stream instance.
+ */
+ BUG_ON(!stream->release);
+ qc_stream_desc_free(stream);
}
if (qc->idle_timer_task) {