diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/adapter.c | 1 | ||||
-rw-r--r-- | src/device.c | 10 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/adapter.c b/src/adapter.c index f983069e..c2304e99 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2295,6 +2295,7 @@ static void create_stored_device_from_profiles(char *key, char *value, device_probe_drivers(device, uuids); + g_slist_foreach(uuids, (GFunc) g_free, NULL); g_slist_free(uuids); } diff --git a/src/device.c b/src/device.c index a5a9d523..7294d3ca 100644 --- a/src/device.c +++ b/src/device.c @@ -668,7 +668,8 @@ void device_probe_drivers(struct btd_device *device, GSList *uuids) continue; device->uuids = g_slist_insert_sorted(device->uuids, - list->data, (GCompareFunc) strcasecmp); + g_strdup(list->data), + (GCompareFunc) strcasecmp); } if (device->tmp_records) { @@ -1349,17 +1350,14 @@ void btd_device_add_uuid(struct btd_device *device, const char *uuid) return; new_uuid = g_strdup(uuid); - - device->uuids = g_slist_append(device->uuids, new_uuid); - - store_profiles(device); - uuid_list = g_slist_append(NULL, new_uuid); device_probe_drivers(device, uuid_list); + g_free(new_uuid); g_slist_free(uuid_list); + store_profiles(device); services_changed(device); } |