[glib: 1/4] Correct memleak introduced by !1885




commit 98abfc9da7d2e7f0e677e0a74f1029d6135db029
Author: Frederic Martinsons <frederic martinsons sigfox com>
Date:   Tue Jan 26 15:27:01 2021 +0100

    Correct memleak introduced by !1885
    
    Signed-off-by: Frederic Martinsons <frederic martinsons sigfox com>

 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);
 }


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