From e5d2b428b86f3a09bbd035332698123971545d99 Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 12 Sep 2019 11:21:56 +0200 Subject: Use g_list_free_full and g_slist_free_full void g_list_free_full (GList *list, GDestroyNotify free_func); void g_slist_free_full (GList *list, GDestroyNotify free_func); Convenience methods, which free all the memory used by a list, and calls free_func on every element's data. --- src/file-utils.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/file-utils.c') diff --git a/src/file-utils.c b/src/file-utils.c index b0949da..c8b1823 100644 --- a/src/file-utils.c +++ b/src/file-utils.c @@ -755,8 +755,7 @@ path_list_free (GList *path_list) { if (path_list == NULL) return; - g_list_foreach (path_list, (GFunc) g_free, NULL); - g_list_free (path_list); + g_list_free_full (path_list, g_free); } -- cgit v1.2.1