[gnome-builder] sysroot: fix leak of argv parameters
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] sysroot: fix leak of argv parameters
- Date: Wed, 9 May 2018 22:00:51 +0000 (UTC)
commit f9bd6817a049a8756859c78a4e770a700f12c8dc
Author: Christian Hergert <chergert redhat com>
Date: Wed May 9 15:00:15 2018 -0700
sysroot: fix leak of argv parameters
src/plugins/sysroot/gbp-sysroot-subprocess-launcher.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/sysroot/gbp-sysroot-subprocess-launcher.c
b/src/plugins/sysroot/gbp-sysroot-subprocess-launcher.c
index e509337e2..8c4203c6e 100644
--- a/src/plugins/sysroot/gbp-sysroot-subprocess-launcher.c
+++ b/src/plugins/sysroot/gbp-sysroot-subprocess-launcher.c
@@ -45,9 +45,9 @@ gbp_sysroot_subprocess_launcher_spawn (IdeSubprocessLauncher *self,
GCancellable *cancellable,
GError **error)
{
- g_autofree gchar *argv = NULL;
const gchar * const *args = NULL;
g_autoptr(GString) cmd = NULL;
+ gchar *argv = NULL;
g_assert (GBP_IS_SYSROOT_SUBPROCESS_LAUNCHER (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
@@ -59,12 +59,14 @@ gbp_sysroot_subprocess_launcher_spawn (IdeSubprocessLauncher *self,
argv = ide_subprocess_launcher_pop_argv (self);
cmd = g_string_new (argv);
+ g_free (argv);
while ((argv = ide_subprocess_launcher_pop_argv (self)) != NULL)
{
g_autofree gchar *arg = g_shell_quote(argv);
g_string_prepend (cmd, " ");
g_string_prepend (cmd, arg);
+ g_free (argv);
}
ide_subprocess_launcher_push_argv (self, "sh");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]