diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c index f8db584c..ffdf4b7b 100644 --- a/drivers/hfpmodem/voicecall.c +++ b/drivers/hfpmodem/voicecall.c @@ -286,8 +286,7 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data) ofono_voicecall_mpty_hint(vc, mpty_ids); - g_slist_foreach(vd->calls, (GFunc) g_free, NULL); - g_slist_free(vd->calls); + g_slist_free_full(vd->calls, g_free); vd->calls = calls; @@ -1256,8 +1255,7 @@ static void hfp_voicecall_remove(struct ofono_voicecall *vc) if (vd->expect_release_source) g_source_remove(vd->expect_release_source); - g_slist_foreach(vd->calls, (GFunc) g_free, NULL); - g_slist_free(vd->calls); + g_slist_free_full(vd->calls, g_free); ofono_voicecall_set_data(vc, NULL);