From 029d78536cb2bb8c56abf53e9b261610e4d13ffe Mon Sep 17 00:00:00 2001 From: Enrico Troeger Date: Sun, 14 Apr 2013 13:22:41 +0200 Subject: [PATCH] Don't try to set std_out and std_err if they are NULL --- src/win32.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/win32.c b/src/win32.c index fb81adac..5f0bb9f7 100644 --- a/src/win32.c +++ b/src/win32.c @@ -1067,8 +1067,10 @@ gboolean win32_spawn(const gchar *dir, gchar **argv, gchar **env, GSpawnFlags fl fail = ret == -1 && errno; if (!fail) { - g_file_get_contents(tmp_file, std_out, NULL, NULL); - g_file_get_contents(tmp_errfile, std_err, NULL, NULL); + if (std_out != NULL) + g_file_get_contents(tmp_file, std_out, NULL, NULL); + if (std_err != NULL) + g_file_get_contents(tmp_errfile, std_err, NULL, NULL); } else if (error) g_set_error_literal(error, G_SPAWN_ERROR, errno, g_strerror(errno));