From 47a3479490ff0cda6149d6941dc5e8bae2ab6b43 Mon Sep 17 00:00:00 2001 From: zuozhiwei Date: Tue, 7 Jul 2026 16:04:04 +0800 Subject: [PATCH] bluez5: destroy update_delay_event on transport_start failure transport_start() creates update_delay_event before ensuring SCO I/O. When spa_bt_transport_ensure_sco_io() fails, the fail path only cleans up codec_data and leaks the event source on the loop. Destroy update_delay_event in fail, matching do_remove_source(). --- spa/plugins/bluez5/media-sink.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spa/plugins/bluez5/media-sink.c b/spa/plugins/bluez5/media-sink.c index 8ee8f7cfb..e42a4a38c 100644 --- a/spa/plugins/bluez5/media-sink.c +++ b/spa/plugins/bluez5/media-sink.c @@ -1685,6 +1685,10 @@ static int transport_start(struct impl *this) return 0; fail: + if (this->update_delay_event) { + spa_loop_utils_destroy_source(this->loop_utils, this->update_delay_event); + this->update_delay_event = NULL; + } if (this->codec_data) { if (this->own_codec_data) this->codec->deinit(this->codec_data);