From f7fb5af2ac15ee55c4ee5384f7a0f8d1f4e939bf Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 15 Oct 2012 23:03:11 +0300 Subject: [PATCH] adapter: Use g_slist_free_full for cleaning up discovery->found --- src/adapter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 8c8b79058..86a21242b 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -549,7 +549,7 @@ static void send_devices_found(struct btd_adapter *adapter) g_dbus_send_message(conn, signal); } -static void invalidate_rssi(gpointer a, gpointer b) +static void invalidate_rssi(gpointer a) { struct btd_device *dev = a; @@ -570,8 +570,7 @@ static void discovery_cleanup(struct btd_adapter *adapter) send_devices_found(adapter); - g_slist_foreach(discovery->found, invalidate_rssi, NULL); - g_slist_free(discovery->found); + g_slist_free_full(discovery->found, invalidate_rssi); g_free(discovery); }