summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-06-03 17:59:53 +0200
committerThomas Haller <thaller@redhat.com>2015-06-03 19:34:38 +0200
commit2071e4794f6cdf551d31584c17c8896d7029e3ac (patch)
tree785810bb008e893d16fc7e72fcae656f1762a8e4
parent9ffcecf86ad2230860cf8fdf5667884782ee64dd (diff)
downloadNetworkManager-2071e4794f6cdf551d31584c17c8896d7029e3ac.tar.gz
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
-rw-r--r--libnm/nm-secret-agent-old.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libnm/nm-secret-agent-old.c b/libnm/nm-secret-agent-old.c
index 7dec0557f2..6df54d433d 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 */