From 3e48e3be40ffb38067dc8cce4e5830cdd9c08aa5 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Fri, 25 Oct 2013 18:01:51 +0200 Subject: [PATCH] gapplication: fix memory leak g_variant_get_child_value() returns a new GVariant, which we must free. https://bugzilla.gnome.org/show_bug.cgi?id=710885 --- gio/gapplicationimpl-dbus.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gio/gapplicationimpl-dbus.c b/gio/gapplicationimpl-dbus.c index d15e643..07709cc 100644 --- a/gio/gapplicationimpl-dbus.c +++ b/gio/gapplicationimpl-dbus.c @@ -889,13 +889,19 @@ g_dbus_command_line_new (GDBusMethodInvocation *invocation) { GDBusCommandLine *gdbcl; GVariant *args; + GVariant *arguments, *platform_data; args = g_dbus_method_invocation_get_parameters (invocation); + arguments = g_variant_get_child_value (args, 1); + platform_data = g_variant_get_child_value (args, 2); gdbcl = g_object_new (g_dbus_command_line_get_type (), - "arguments", g_variant_get_child_value (args, 1), - "platform-data", g_variant_get_child_value (args, 2), + "arguments", arguments, + "platform-data", platform_data, NULL); + g_variant_unref (arguments); + g_variant_unref (platform_data); + gdbcl->connection = g_dbus_method_invocation_get_connection (invocation); gdbcl->bus_name = g_dbus_method_invocation_get_sender (invocation); g_variant_get_child (args, 0, "&o", &gdbcl->object_path); -- 2.7.4