[gnome-builder] autotools: don't leak cwd when building subprocess



commit 8ac0d40e5bf4f9d545f3944fa472d49994601567
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 12 19:11:43 2016 -0700

    autotools: don't leak cwd when building subprocess

 plugins/autotools/ide-autotools-build-system.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plugins/autotools/ide-autotools-build-system.c b/plugins/autotools/ide-autotools-build-system.c
index 6b9e284..c8f82e5 100644
--- a/plugins/autotools/ide-autotools-build-system.c
+++ b/plugins/autotools/ide-autotools-build-system.c
@@ -950,6 +950,7 @@ simple_make_command (GFile            *directory,
 {
   g_autoptr(IdeSubprocessLauncher) launcher = NULL;
   g_autoptr(IdeSubprocess) subprocess = NULL;
+  g_autofree gchar *cwd = NULL;
   GCancellable *cancellable;
   IdeRuntime *runtime;
   GError *error = NULL;
@@ -985,7 +986,8 @@ simple_make_command (GFile            *directory,
       return;
     }
 
-  ide_subprocess_launcher_set_cwd (launcher, g_file_get_path (directory));
+  cwd = g_file_get_path (directory);
+  ide_subprocess_launcher_set_cwd (launcher, cwd);
 
   if (ide_runtime_contains_program_in_path (runtime, "gmake", cancellable))
     ide_subprocess_launcher_push_argv (launcher, "gmake");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]