diff options
author | Miloslav Trmač <mitr@redhat.com> | 2017-02-09 19:58:12 +0100 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2018-04-02 17:32:25 -0400 |
commit | 58b7f4e72abb3849ecb8ef56e70874e0aec1a574 (patch) | |
tree | 1d3be039a310100e37e66efae14ad6a9ca02ca34 | |
parent | 54c19b05d1ca3eeb95b12e89ac2a967374af7a4a (diff) | |
download | polkit-58b7f4e72abb3849ecb8ef56e70874e0aec1a574.tar.gz |
Fix a memory leak on agent authentication cancellation
(This is cancellation by the daemon, possibly requested by the client, not by the agent.)
https://bugs.freedesktop.org/show_bug.cgi?id=99741
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-rw-r--r-- | src/polkitbackend/polkitbackendinteractiveauthority.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c index 270d3ea..1cd60d3 100644 --- a/src/polkitbackend/polkitbackendinteractiveauthority.c +++ b/src/polkitbackend/polkitbackendinteractiveauthority.c @@ -2437,13 +2437,18 @@ authentication_agent_cancel_cb (GDBusProxy *proxy, GAsyncResult *res, gpointer user_data) { + GVariant *result; GError *error; + error = NULL; - if (!g_dbus_proxy_call_finish (proxy, res, &error)) + result = g_dbus_proxy_call_finish (proxy, res, &error); + if (result == NULL) { g_printerr ("Error cancelling authentication: %s\n", error->message); g_error_free (error); } + else + g_variant_unref (result); } static void |