From f823f1052dfd6ab7ed4f8182ab0eaf4e6fba1047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Sat, 15 Feb 2025 15:19:04 +0100 Subject: [PATCH] monitor-dbus-tests: Use autopointer to free errors Part-of: --- src/tests/monitor-dbus-tests.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tests/monitor-dbus-tests.c b/src/tests/monitor-dbus-tests.c index 82e3178c6..fe831fbbc 100644 --- a/src/tests/monitor-dbus-tests.c +++ b/src/tests/monitor-dbus-tests.c @@ -238,7 +238,7 @@ read_all_cb (GObject *source_object, gpointer user_data) { gboolean *done = user_data; - GError *error = NULL; + g_autoptr (GError) error = NULL; g_input_stream_read_all_finish (G_INPUT_STREAM (source_object), res, @@ -255,7 +255,7 @@ wait_check_cb (GObject *source_object, gpointer user_data) { gboolean *done = user_data; - GError *error = NULL; + g_autoptr (GError) error = NULL; g_subprocess_wait_check_finish (G_SUBPROCESS (source_object), res, &error); g_assert_no_error (error); @@ -269,7 +269,7 @@ save_output (const char *output, { const char *gdctl_result_dir; char *output_path; - GError *error = NULL; + g_autoptr (GError) error = NULL; gdctl_result_dir = g_getenv ("MUTTER_GDCTL_TEST_RESULT_DIR"); g_assert_no_errno (g_mkdir_with_parents (gdctl_result_dir, 0755)); @@ -290,7 +290,7 @@ run_diff (const char *output_path, { g_autoptr (GSubprocessLauncher) launcher = NULL; g_autoptr (GSubprocess) subprocess = NULL; - GError *error = NULL; + g_autoptr (GError) error = NULL; launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE); subprocess = g_subprocess_launcher_spawn (launcher, @@ -313,8 +313,8 @@ check_gdctl_result (const char *first_argument, char *arg; g_autoptr (GSubprocessLauncher) launcher = NULL; g_autoptr (GSubprocess) subprocess = NULL; + g_autoptr (GError) error = NULL; gboolean process_done = FALSE; - GError *error = NULL; args = g_ptr_array_new (); g_ptr_array_add (args, gdctl_path); @@ -351,7 +351,7 @@ check_gdctl_output (const char *expected_output_file, g_autofree char *output = NULL; gboolean read_done = FALSE; gboolean process_done = FALSE; - GError *error = NULL; + g_autoptr (GError) error = NULL; g_autofree char *expected_output_path = NULL; g_autofree char *expected_output = NULL;