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.
This commit is contained in:
Amaury Denoyelle 2022-04-01 16:41:21 +02:00
parent 6057b4090e
commit c9acc31018

View File

@ -3808,8 +3808,11 @@ static void quic_conn_release(struct quic_conn *qc)
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) {