Skip to content

Commit

Permalink
sysroot/deploy: Drop unnecessary g_ptr_array_free
Browse files Browse the repository at this point in the history
We can just reference the pdata, and autoptr the array.
  • Loading branch information
cgwalters committed Nov 30, 2023
1 parent 9fe49b9 commit 8196dac
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/libostree/ostree-sysroot-deploy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3225,8 +3225,7 @@ run_in_deployment (int deployment_dfd, const gchar *const *child_argv, gint *exi
"/sbin",
NULL };

GPtrArray *args = g_ptr_array_new ();
g_autofree gchar **args_raw = NULL;
g_autoptr (GPtrArray) args = g_ptr_array_new ();

for (char **it = (char **)COMMON_ARGV; it && *it; it++)
g_ptr_array_add (args, it);
Expand All @@ -3236,9 +3235,7 @@ run_in_deployment (int deployment_dfd, const gchar *const *child_argv, gint *exi

g_ptr_array_add (args, NULL);

args_raw = (gchar **)g_ptr_array_free (args, FALSE);

return g_spawn_sync (NULL, args_raw, NULL, 0, &child_setup_fchdir,
return g_spawn_sync (NULL, (char **)args->pdata, NULL, 0, &child_setup_fchdir,
(gpointer)(uintptr_t)deployment_dfd, stdout, NULL, exit_status, error);
}

Expand Down

0 comments on commit 8196dac

Please sign in to comment.