diff --git a/attrib/client.c b/attrib/client.c
index 71df532..c9629c4 100644
--- a/attrib/client.c
+++ b/attrib/client.c
g_dbus_remove_watch(prim->gatt->conn, watcher->id);
}
- g_slist_foreach(prim->chars, (GFunc) characteristic_free, NULL);
- g_slist_free(prim->chars);
+ g_slist_free_full(prim->chars, characteristic_free);
g_free(prim->path);
g_free(prim);
}
{
struct gatt_service *gatt = user_data;
- g_slist_foreach(gatt->primary, (GFunc) primary_free, NULL);
- g_slist_free(gatt->primary);
+ g_slist_free_full(gatt->primary, primary_free);
g_attrib_unref(gatt->attrib);
g_free(gatt->path);
btd_device_unref(gatt->dev);
diff --git a/attrib/gatt.c b/attrib/gatt.c
index 1ed78ec..a27d1af 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
static void discover_char_free(struct discover_char *dc)
{
- g_slist_foreach(dc->characteristics, (GFunc) g_free, NULL);
- g_slist_free(dc->characteristics);
+ g_slist_free_full(dc->characteristics, g_free);
g_attrib_unref(dc->attrib);
g_free(dc->uuid);
g_free(dc);