From abf9cc54c06121833ac7f144e466508a14131329 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sun, 3 Sep 2023 18:37:23 +0000 Subject: [PATCH] stream-ws: Clean up exec-and-send resources --- src/stream-ws.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stream-ws.c b/src/stream-ws.c index 17088d7..2e178ed 100644 --- a/src/stream-ws.c +++ b/src/stream-ws.c @@ -256,6 +256,10 @@ static struct rcbuf* stream_ws_chained_exec(struct stream* tcp_stream, struct rcbuf* buf = ctx->exec(&ws->base, ctx->userdata); + // TODO: This also needs to be cleaned it it's left on the send queue + // when the stream is destroyed. + free(ctx->userdata); + struct vec out; vec_init(&out, WS_HEADER_MIN_SIZE + buf->size + 1); @@ -268,6 +272,7 @@ static struct rcbuf* stream_ws_chained_exec(struct stream* tcp_stream, out.len += head_len; vec_append(&out, buf->payload, buf->size); + rcbuf_unref(buf); return rcbuf_new(out.data, out.len); }