diff options
author | John Ernberg <john.ernberg@actia.se> | 2016-04-22 13:10:06 +0000 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2016-04-22 15:27:28 -0500 |
commit | f987e0b3117b585cb7f9abbfe83c4cfc1ff2eca8 (patch) | |
tree | 4a2423f0ac32954dcebf2ab89be77d16dd4f101f | |
parent | 875968d270681f44ac95c084a5e6fc372ea61e21 (diff) | |
download | ofono-f987e0b3117b585cb7f9abbfe83c4cfc1ff2eca8.tar.gz |
cbs: use g_slist_free_full
-rw-r--r-- | src/cbs.c | 27 |
1 files changed, 9 insertions, 18 deletions
@@ -272,8 +272,7 @@ void ofono_cbs_notify(struct ofono_cbs *cbs, const unsigned char *pdu, out: g_free(message); - g_slist_foreach(cbs_list, (GFunc)g_free, NULL); - g_slist_free(cbs_list); + g_slist_free_full(cbs_list, g_free); } static DBusMessage *cbs_get_properties(DBusConnection *conn, @@ -337,8 +336,7 @@ static void cbs_set_topics_cb(const struct ofono_error *error, void *data) char *topics; if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { - g_slist_foreach(cbs->new_topics, (GFunc)g_free, NULL); - g_slist_free(cbs->new_topics); + g_slist_free_full(cbs->new_topics, g_free); cbs->new_topics = NULL; DBG("Setting Cell Broadcast topics failed"); @@ -347,8 +345,7 @@ static void cbs_set_topics_cb(const struct ofono_error *error, void *data) return; } - g_slist_foreach(cbs->topics, (GFunc)g_free, NULL); - g_slist_free(cbs->topics); + g_slist_free_full(cbs->topics, g_free); cbs->topics = cbs->new_topics; cbs->new_topics = NULL; @@ -590,21 +587,18 @@ static void cbs_unregister(struct ofono_atom *atom) ofono_modem_remove_interface(modem, OFONO_CELL_BROADCAST_INTERFACE); if (cbs->topics) { - g_slist_foreach(cbs->topics, (GFunc) g_free, NULL); - g_slist_free(cbs->topics); + g_slist_free_full(cbs->topics, g_free); cbs->topics = NULL; } if (cbs->new_topics) { - g_slist_foreach(cbs->new_topics, (GFunc) g_free, NULL); - g_slist_free(cbs->new_topics); + g_slist_free_full(cbs->new_topics, g_free); cbs->new_topics = NULL; } if (cbs->efcbmid_length) { cbs->efcbmid_length = 0; - g_slist_foreach(cbs->efcbmid_contents, (GFunc) g_free, NULL); - g_slist_free(cbs->efcbmid_contents); + g_slist_free_full(cbs->efcbmid_contents, g_free); cbs->efcbmid_contents = NULL; } @@ -729,15 +723,13 @@ static void cbs_got_file_contents(struct ofono_cbs *cbs) if (cbs->efcbmi_length) { cbs->efcbmi_length = 0; - g_slist_foreach(cbs->efcbmi_contents, (GFunc) g_free, NULL); - g_slist_free(cbs->efcbmi_contents); + g_slist_free_full(cbs->efcbmi_contents, g_free); cbs->efcbmi_contents = NULL; } if (cbs->efcbmir_length) { cbs->efcbmir_length = 0; - g_slist_foreach(cbs->efcbmir_contents, (GFunc) g_free, NULL); - g_slist_free(cbs->efcbmir_contents); + g_slist_free_full(cbs->efcbmir_contents, g_free); cbs->efcbmir_contents = NULL; } @@ -907,8 +899,7 @@ static void cbs_efcbmid_changed(int id, void *userdata) if (cbs->efcbmid_length) { cbs->efcbmid_length = 0; - g_slist_foreach(cbs->efcbmid_contents, (GFunc) g_free, NULL); - g_slist_free(cbs->efcbmid_contents); + g_slist_free_full(cbs->efcbmid_contents, g_free); cbs->efcbmid_contents = NULL; } |