summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 474623a)
raw | patch | inline | side by side (parent: 474623a)
author | Max Kellermann <max.kellermann@gmail.com> | |
Tue, 21 Mar 2017 21:05:10 +0000 (22:05 +0100) | ||
committer | Max Kellermann <max.kellermann@gmail.com> | |
Tue, 21 Mar 2017 21:05:10 +0000 (22:05 +0100) |
src/colors.c | patch | blob | history | |
src/utils.c | patch | blob | history |
diff --git a/src/colors.c b/src/colors.c
index 3b100bc22f3c06ea30614b69a48d0710a133f44d..5a79fd9bbfff8b2c6a7967e499af18df19c98544 100644 (file)
--- a/src/colors.c
+++ b/src/colors.c
/* free the color_definition_list */
if (color_definition_list) {
- GList *list = color_definition_list;
-
- while (list) {
- g_free(list->data);
- list=list->next;
- }
-
- g_list_free(color_definition_list);
+ g_list_free_full(color_definition_list, g_free);
color_definition_list = NULL;
}
}
diff --git a/src/utils.c b/src/utils.c
index d46f521f53b9ff9e816e9b1898d7145d85ef6b58..3f327f4b0b80914025e6e925452114ed56ef1417 100644 (file)
--- a/src/utils.c
+++ b/src/utils.c
GList *
string_list_free(GList *string_list)
{
- GList *list = g_list_first(string_list);
-
- while (list) {
- g_free(list->data);
- list->data = NULL;
- list = list->next;
- }
-
- g_list_free(string_list);
+ g_list_free_full(string_list, g_free);
return NULL;
}