summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorAlessandro Bono <alessandro.bono369@gmail.com>2022-11-09 11:06:09 +0100
committerRay Strode <halfline@gmail.com>2023-04-28 19:41:28 +0000
commit536c38cd936c7c7030922556b6d351f5224fe937 (patch)
tree9aa2891e8f93ae4c579a95606b5d5f64a2d72e28 /daemon
parent681b6f03e7762ed411a281cf1adfc7216c88549c (diff)
downloadgdm-536c38cd936c7c7030922556b6d351f5224fe937.tar.gz
gdm-session-worker-job: Let GPtrArray deal with its content
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gdm-session-worker-job.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/daemon/gdm-session-worker-job.c b/daemon/gdm-session-worker-job.c
index 3d4691d9..7466d1fc 100644
--- a/daemon/gdm-session-worker-job.c
+++ b/daemon/gdm-session-worker-job.c
@@ -207,7 +207,7 @@ get_job_arguments (GdmSessionWorkerJob *job,
return NULL;
}
- args = g_ptr_array_new ();
+ args = g_ptr_array_new_with_free_func (g_free);
g_ptr_array_add (args, g_strdup (argv[0]));
g_ptr_array_add (args, g_strdup (name));
for (i = 1; argv[i] != NULL; i++) {
@@ -225,7 +225,7 @@ get_job_environment (GdmSessionWorkerJob *job)
g_autoptr(GPtrArray) env = NULL;
g_autoptr(GHashTable) hash = NULL;
- 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);
@@ -275,10 +275,6 @@ gdm_session_worker_job_spawn (GdmSessionWorkerJob *session_worker_job,
NULL,
&error);
- g_ptr_array_foreach (args, (GFunc)g_free, NULL);
-
- g_ptr_array_foreach (env, (GFunc)g_free, NULL);
-
if (! ret) {
g_warning ("Could not start command '%s': %s",
session_worker_job->command,