From 73eee8d64ed4a074bb17d26a6e387a4c272f94f6 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 23 Aug 2017 11:24:32 +0100 Subject: [PATCH] tests: Fix some leaks and double-frees in the GSubprocess tests Signed-off-by: Philip Withnall https://bugzilla.gnome.org/show_bug.cgi?id=786456 --- gio/tests/gsubprocess.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gio/tests/gsubprocess.c b/gio/tests/gsubprocess.c index d5fffcce9..39f748bf4 100644 --- a/gio/tests/gsubprocess.c +++ b/gio/tests/gsubprocess.c @@ -805,8 +805,7 @@ test_communicate (void) stdout_data = g_bytes_get_data (stdout, &stdout_len); g_assert_cmpmem (stdout_data, stdout_len, "hello world", 11); - g_bytes_unref (stdout); - + g_bytes_unref (input); g_bytes_unref (stdout); g_object_unref (proc); @@ -1067,6 +1066,7 @@ test_env (void) g_strfreev (split); g_free (result); g_object_unref (proc); + g_object_unref (launcher); } /* Test that explicitly inheriting and modifying the parent process’ @@ -1112,6 +1112,7 @@ test_env_inherit (void) g_strfreev (split); g_free (result); g_object_unref (proc); + g_object_unref (launcher); } static void @@ -1145,6 +1146,7 @@ test_cwd (void) g_free (result); g_object_unref (proc); + g_object_unref (launcher); } #ifdef G_OS_UNIX static void @@ -1400,6 +1402,8 @@ test_launcher_environment (void) g_free (out); g_object_unref (proc); + g_object_unref (launcher); + g_ptr_array_unref (args); } int