From c751320a1bb4f81e94175aa89707ea5a0d594802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Thu, 9 Feb 2017 19:38:17 +0100 Subject: [PATCH 7/9] Fix error handling in polkit_authority_enumerate_temporary_authorizations_finish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix memory leaks, and don't return a pointer to freed memory. https://bugs.freedesktop.org/show_bug.cgi?id=99741 Signed-off-by: Miloslav Trmač --- src/polkit/polkitauthority.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/polkit/polkitauthority.c b/src/polkit/polkitauthority.c index b783c0e..404954f 100644 --- a/src/polkit/polkitauthority.c +++ b/src/polkit/polkitauthority.c @@ -1698,11 +1698,13 @@ polkit_authority_enumerate_temporary_authorizations_finish (PolkitAuthority *aut g_prefix_error (error, "Error serializing return value of EnumerateTemporaryAuthorizations: "); g_list_foreach (ret, (GFunc) g_object_unref, NULL); g_list_free (ret); - goto out; + ret = NULL; + goto out_array; } ret = g_list_prepend (ret, auth); } ret = g_list_reverse (ret); + out_array: g_variant_unref (array); g_variant_unref (value); -- 2.7.4