From: Colin Walters Date: Thu, 30 Nov 2023 15:26:32 +0000 (-0500) Subject: sysroot/deploy: Drop unnecessary g_ptr_array_free X-Git-Tag: archive/raspbian/2023.8-1+rpi1^2~9^2^2~6^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=68cc19600b5926d8977039553f836cf70dfd8486;p=ostree.git sysroot/deploy: Drop unnecessary g_ptr_array_free We can just reference the pdata, and autoptr the array. --- diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 3eeb2098..74c84d27 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -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); @@ -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); }