diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 482de4a..7c0f9c5 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
stream->starting = TRUE;
}
-static void a2dp_stream_free(struct a2dp_stream *stream)
+static void a2dp_stream_free(void *data)
{
+ struct a2dp_stream *stream = data;
+
avdtp_unref(stream->session);
free(stream);
}
avdtp_unregister_sep(server->seps, &server->seid_pool, sep->lsep);
+ queue_destroy(sep->streams, a2dp_stream_free);
g_free(sep);
if (!queue_isempty(server->seps))