From 9793870b2372763b09e37e616c93781f3fe17865 Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Fri, 28 Nov 2014 13:43:07 +0100 Subject: [PATCH] bluez5: Fix free order of adapters and devices Because the adapters reference the devices hashmap on free, we mush free the adapters hashmap first and then the devices hashmap. Reported-by: Alexander Patrakov Signed-off-by: David Henningsson --- src/modules/bluetooth/bluez5-util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c index 6894e83f4..0b234aeb5 100644 --- a/src/modules/bluetooth/bluez5-util.c +++ b/src/modules/bluetooth/bluez5-util.c @@ -1660,12 +1660,12 @@ void pa_bluetooth_discovery_unref(pa_bluetooth_discovery *y) { pa_dbus_free_pending_list(&y->pending); - if (y->devices) - pa_hashmap_free(y->devices); - if (y->adapters) pa_hashmap_free(y->adapters); + if (y->devices) + pa_hashmap_free(y->devices); + if (y->transports) { pa_assert(pa_hashmap_isempty(y->transports)); pa_hashmap_free(y->transports); -- 2.34.1