From 98abfc9da7d2e7f0e677e0a74f1029d6135db029 Mon Sep 17 00:00:00 2001 From: Frederic Martinsons Date: Tue, 26 Jan 2021 15:27:01 +0100 Subject: [PATCH] Correct memleak introduced by !1885 Signed-off-by: Frederic Martinsons --- gio/tests/gdbus-names.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/gio/tests/gdbus-names.c b/gio/tests/gdbus-names.c index 05d2015d0..5f36cc009 100644 --- a/gio/tests/gdbus-names.c +++ b/gio/tests/gdbus-names.c @@ -613,6 +613,7 @@ stop_service (GDBusConnection *connection, { GError *error = NULL; GDBusProxy *proxy = NULL; + GVariant *result = NULL; data->num_vanished = 0; @@ -626,15 +627,17 @@ stop_service (GDBusConnection *connection, &error); g_assert_no_error (error); - g_dbus_proxy_call_sync (proxy, - "Quit", - NULL, - G_DBUS_CALL_FLAGS_NO_AUTO_START, - 100, - NULL, - &error); + result = g_dbus_proxy_call_sync (proxy, + "Quit", + NULL, + G_DBUS_CALL_FLAGS_NO_AUTO_START, + 100, + NULL, + &error); g_assert_no_error (error); g_object_unref (proxy); + if (result) + g_variant_unref (result); while (data->num_vanished == 0) g_main_loop_run (loop); }