From deda8a10d1bdfcf276778afa0daff372e5140ef3 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 15 Mar 2023 15:56:45 +0100 Subject: [PATCH] module-raop: fix memory leak Don't leak the pending messages. --- src/modules/module-raop/rtsp-client.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/module-raop/rtsp-client.c b/src/modules/module-raop/rtsp-client.c index 11bf3819c..003291cb7 100644 --- a/src/modules/module-raop/rtsp-client.c +++ b/src/modules/module-raop/rtsp-client.c @@ -530,6 +530,8 @@ int pw_rtsp_client_connect(struct pw_rtsp_client *client, int pw_rtsp_client_disconnect(struct pw_rtsp_client *client) { + struct message *msg; + if (client->source == NULL) return 0; @@ -539,6 +541,11 @@ int pw_rtsp_client_disconnect(struct pw_rtsp_client *client) client->url = NULL; free(client->session_id); client->session_id = NULL; + + spa_list_consume(msg, &client->messages, link) { + spa_list_remove(&msg->link); + free(msg); + } pw_rtsp_client_emit_disconnected(client); return 0; }