From f068cab487bddaa9a8a1765d8a89e5673c80ef4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Thu, 9 Feb 2017 19:58:12 +0100 Subject: [PATCH 9/9] Fix a memory leak on agent authentication cancellation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (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č --- src/polkitbackend/polkitbackendinteractiveauthority.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c index b8096b3..e595bd5 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 -- 2.7.4