[glib: 3/5] tests: Fix some larger memory leaks in gdbus-proxy



commit 3d4a168715a8ac2587088ffbf5fddbda17f52233
Author: Philip Withnall <withnall endlessm com>
Date:   Thu Mar 7 13:57:38 2019 +0000

    tests: Fix some larger memory leaks in gdbus-proxy
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 gio/tests/gdbus-proxy.c      | 4 +++-
 gio/tests/gdbus-testserver.c | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gio/tests/gdbus-proxy.c b/gio/tests/gdbus-proxy.c
index f40492bed..05b22ea1c 100644
--- a/gio/tests/gdbus-proxy.c
+++ b/gio/tests/gdbus-proxy.c
@@ -626,7 +626,9 @@ test_expected_interface (GDBusProxy *proxy)
       /* Also check that we complain if setting a cached property of the wrong type */
       g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
                              "*Trying to set property y of type s but according to the expected interface 
the type is y*");
-      g_dbus_proxy_set_cached_property (proxy, "y", g_variant_new_string ("error_me_out!"));
+      value = g_variant_ref_sink (g_variant_new_string ("error_me_out!"));
+      g_dbus_proxy_set_cached_property (proxy, "y", value);
+      g_variant_unref (value);
       g_test_assert_expected_messages ();
     }
 
diff --git a/gio/tests/gdbus-testserver.c b/gio/tests/gdbus-testserver.c
index 7f99a1946..dd0d5ba5a 100644
--- a/gio/tests/gdbus-testserver.c
+++ b/gio/tests/gdbus-testserver.c
@@ -884,6 +884,7 @@ main (int argc, char *argv[])
   g_bus_unown_name (owner_id);
 
   g_dbus_node_info_unref (introspection_data);
+  g_hash_table_unref (properties);
 
   return 0;
 }


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