mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-20 14:19:16 +02:00
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
This commit is contained in:
parent
0e1924a66c
commit
3e48e3be40
@ -889,13 +889,19 @@ g_dbus_command_line_new (GDBusMethodInvocation *invocation)
|
|||||||
{
|
{
|
||||||
GDBusCommandLine *gdbcl;
|
GDBusCommandLine *gdbcl;
|
||||||
GVariant *args;
|
GVariant *args;
|
||||||
|
GVariant *arguments, *platform_data;
|
||||||
|
|
||||||
args = g_dbus_method_invocation_get_parameters (invocation);
|
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 (),
|
gdbcl = g_object_new (g_dbus_command_line_get_type (),
|
||||||
"arguments", g_variant_get_child_value (args, 1),
|
"arguments", arguments,
|
||||||
"platform-data", g_variant_get_child_value (args, 2),
|
"platform-data", platform_data,
|
||||||
NULL);
|
NULL);
|
||||||
|
g_variant_unref (arguments);
|
||||||
|
g_variant_unref (platform_data);
|
||||||
|
|
||||||
gdbcl->connection = g_dbus_method_invocation_get_connection (invocation);
|
gdbcl->connection = g_dbus_method_invocation_get_connection (invocation);
|
||||||
gdbcl->bus_name = g_dbus_method_invocation_get_sender (invocation);
|
gdbcl->bus_name = g_dbus_method_invocation_get_sender (invocation);
|
||||||
g_variant_get_child (args, 0, "&o", &gdbcl->object_path);
|
g_variant_get_child (args, 0, "&o", &gdbcl->object_path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user