summaryrefslogtreecommitdiff
path: root/glib/gshell.c
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2012-01-05 04:31:21 +0100
committerJavier Jardón <jjardon@gnome.org>2012-01-05 04:57:48 +0100
commite3d53d5529522a8db4e1711b47baa44250ce09fd (patch)
treeb7552b50bc88d10581f4d99c632daacc48bb406a /glib/gshell.c
parentc735b54a6384ff170ca32906ad7eae64a338e1d6 (diff)
downloadglib-e3d53d5529522a8db4e1711b47baa44250ce09fd.tar.gz
glib/*: Use g_slist_free_full() convenience function
Diffstat (limited to 'glib/gshell.c')
-rw-r--r--glib/gshell.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/glib/gshell.c b/glib/gshell.c
index 315f50226..205519e29 100644
--- a/glib/gshell.c
+++ b/glib/gshell.c
@@ -587,12 +587,8 @@ tokenize_command_line (const gchar *command_line,
error:
g_assert (error == NULL || *error != NULL);
-
- if (retval)
- {
- g_slist_foreach (retval, (GFunc)g_free, NULL);
- g_slist_free (retval);
- }
+
+ g_slist_free_full (retval, g_free);
return NULL;
}
@@ -667,8 +663,7 @@ g_shell_parse_argv (const gchar *command_line,
++i;
}
- g_slist_foreach (tokens, (GFunc)g_free, NULL);
- g_slist_free (tokens);
+ g_slist_free_full (tokens, g_free);
if (argcp)
*argcp = argc;
@@ -684,8 +679,7 @@ g_shell_parse_argv (const gchar *command_line,
g_assert (error == NULL || *error != NULL);
g_strfreev (argv);
- g_slist_foreach (tokens, (GFunc) g_free, NULL);
- g_slist_free (tokens);
+ g_slist_free_full (tokens, g_free);
return FALSE;
}