Fix memory leak
authorRicardo Mones <ricardo@mones.org>
Thu, 30 Jan 2014 09:34:19 +0000 (10:34 +0100)
committerRicardo Mones <ricardo@mones.org>
Thu, 30 Jan 2014 09:34:19 +0000 (10:34 +0100)
src/common/utils.c

index fb4ba75..ff476f1 100644 (file)
@@ -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
 }