From d5b17abe3382a4efdd0703618b03303cb587fed2 Mon Sep 17 00:00:00 2001 From: Alessandro Bono Date: Tue, 8 Nov 2022 14:55:07 +0100 Subject: gdm-common: Let GPtrArray deal with its content --- common/gdm-common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'common') diff --git a/common/gdm-common.c b/common/gdm-common.c index 3e31f426..741c4a8c 100644 --- a/common/gdm-common.c +++ b/common/gdm-common.c @@ -578,7 +578,7 @@ gdm_get_script_environment (const char *username, GHashTable *hash; struct passwd *pwent; - env = g_ptr_array_new (); + env = g_ptr_array_new_with_free_func (g_free); /* create a hash table of current environment, then update keys has necessary */ hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); @@ -724,7 +724,6 @@ gdm_run_script (const char *dir, &status, &error); - g_ptr_array_foreach (env, (GFunc)g_free, NULL); g_ptr_array_free (env, TRUE); g_strfreev (argv); -- cgit v1.2.1