diff mbox series

[BlueZ,v2,07/14] transport: Unset transport owner before owner free

Message ID 20241025122146.17925-8-iulia.tanasescu@nxp.com
State Superseded
Headers show
Series bap: Add support for Broadcast Sink AC 13 | expand

Commit Message

Iulia Tanasescu Oct. 25, 2024, 12:21 p.m. UTC
This sets the transport owner back to NULL, before the owner object
is freed.
---
 profiles/audio/transport.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index d71013077..dafd1c471 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -287,10 +287,15 @@  static void media_owner_remove(struct media_owner *owner)
 
 static void media_owner_free(struct media_owner *owner)
 {
+	struct media_transport *transport = owner->transport;
+
 	DBG("Owner %s", owner->name);
 
 	media_owner_remove(owner);
 
+	if (transport)
+		transport->owner = NULL;
+
 	g_free(owner->name);
 	g_free(owner);
 }