From 2071e4794f6cdf551d31584c17c8896d7029e3ac Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 3 Jun 2015 17:59:53 +0200 Subject: [PATCH] libnm: fix take ownership of floating argument in NMSecretAgentOld:get_secrets_cb() The previous patch 9ffcecf86ad2230860cf8fdf5667884782ee64dd was completely wrong. It tried to fix callers that provided a floating GVariant reference. We require the caller to unref @secrets, so the correct fix it to ensure that the reference is not floating. Fixes: 9ffcecf86ad2230860cf8fdf5667884782ee64dd Fixes: 6793a32a8c5445103ba3680bb5e4c31727096099 --- libnm/nm-secret-agent-old.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libnm/nm-secret-agent-old.c b/libnm/nm-secret-agent-old.c index 7dec0557f..6df54d433 100644 --- a/libnm/nm-secret-agent-old.c +++ b/libnm/nm-secret-agent-old.c @@ -301,8 +301,9 @@ get_secrets_cb (NMSecretAgentOld *self, if (error) g_dbus_method_invocation_return_gerror (info->context, error); else { + g_variant_take_ref (secrets); g_dbus_method_invocation_return_value (info->context, - g_variant_new ("(a{sa{sv}})", secrets)); + g_variant_new ("(@a{sa{sv}})", secrets)); } /* Remove the request from internal tracking */