[glib] gapplication: fix memory leak
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gapplication: fix memory leak
- Date: Sat, 26 Oct 2013 12:55:32 +0000 (UTC)
commit 3e48e3be40ffb38067dc8cce4e5830cdd9c08aa5
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Fri Oct 25 18:01:51 2013 +0200
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 files 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]