From 47a4c73cd5530a36c430d068e171d357c0f66a81 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Thu, 10 Jul 2025 13:08:54 +0300 Subject: [PATCH] avdtp: fix not adding stream to global streams list stream_new() shall be used to create new avdtp_stream, so that they can be found from global list. Fix one case where it was not used. Fixes crash when unregistering lsep and then disconnecting, due to stream for the removed lsep not being cleaned up when SEP is freed. Fixes: https://github.com/bluez/bluez/issues/1325 --- profiles/audio/avdtp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c index 17671a1ba..b849896a9 100644 --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c @@ -3575,10 +3575,7 @@ int avdtp_set_configuration(struct avdtp *session, DBG("%p: int_seid=%u, acp_seid=%u", session, lsep->info.seid, rsep->seid); - new_stream = g_new0(struct avdtp_stream, 1); - new_stream->session = session; - new_stream->lsep = lsep; - new_stream->rseid = rsep->seid; + new_stream = stream_new(session, lsep, rsep->seid); if (rsep->delay_reporting && lsep->delay_reporting) { struct avdtp_service_capability *delay_reporting; -- 2.47.3