From f194be5c746d1ad6f093d1b175b7b0e1ccafad58 Mon Sep 17 00:00:00 2001 From: Bruna Moreira Date: Mon, 25 Apr 2011 14:48:10 -0400 Subject: [PATCH] Fix segfault when removing device The device_register_services() function uses g_slist_concat(), therefore the passed list should not be freed. The primary_cb() function from GATT library was freeing the services list using discover_primary_free(). To fix this, the device_register_services() function receives a copy of services list if called from inside a gatt_discover_primary() callback. --- src/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index 44bf76f32..72774bf56 100644 --- a/src/device.c +++ b/src/device.c @@ -1600,7 +1600,7 @@ static void primary_cb(GSList *services, guint8 status, gpointer user_data) device_probe_drivers(device, uuids); - device_register_services(req->conn, device, services, -1); + device_register_services(req->conn, device, g_slist_copy(services), -1); g_slist_free(uuids); -- 2.47.3