From 620e382586efcb2bfdb02354b2b55e097a80b4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Thu, 9 Feb 2017 19:53:54 +0100 Subject: [PATCH 8/9] Fix a memory leak per agent authentication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://bugs.freedesktop.org/show_bug.cgi?id=99741 Signed-off-by: Miloslav Trmač --- src/polkitbackend/polkitbackendinteractiveauthority.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c index bf0ee48..b8096b3 100644 --- a/src/polkitbackend/polkitbackendinteractiveauthority.c +++ b/src/polkitbackend/polkitbackendinteractiveauthority.c @@ -1906,15 +1906,15 @@ authentication_agent_begin_cb (GDBusProxy *proxy, AuthenticationSession *session = user_data; gboolean gained_authorization; gboolean was_dismissed; + GVariant *result; GError *error; was_dismissed = FALSE; gained_authorization = FALSE; 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 performing authentication: %s (%s %d)\n", error->message, @@ -1926,6 +1926,7 @@ authentication_agent_begin_cb (GDBusProxy *proxy, } else { + g_variant_unref (result); gained_authorization = session->is_authenticated; g_debug ("Authentication complete, is_authenticated = %d", session->is_authenticated); } -- 2.7.4