commit 5f7b75cf29bd6ab29e943ab1e4ca22e595549893
parent a97efc7c19118ddf351ef06b4a26af817ea54cb5
Author: Ricardo Mones <ricardo@mones.org>
Date: Thu, 30 Jan 2014 10:34:19 +0100
Fix memory leak
Diffstat:
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/common/utils.c b/src/common/utils.c
@@ -260,10 +260,7 @@ void slist_free_strings_full(GSList *list)
#if GLIB_CHECK_VERSION(2,28,0)
g_slist_free_full(list, (GDestroyNotify)g_free);
#else
- while (list != NULL) {
- g_free(list->data);
- list = list->next;
- }
+ g_slist_foreach(list, (GFunc)g_free, NULL);
g_slist_free(list);
#endif
}