summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2017-02-09 19:38:17 +0100
committerRay Strode <rstrode@redhat.com>2018-04-03 13:13:39 -0400
commitdbc5925e14a04f4a6278d5338c1b53187aa29bd4 (patch)
tree11b0115d9d9553e2ac45897e229fb29d4558500c
parent08fe855c632f8b06b740cd34b126802e466b2bdc (diff)
downloadpolkit-dbc5925e14a04f4a6278d5338c1b53187aa29bd4.tar.gz
Fix error handling in polkit_authority_enumerate_temporary_authorizations_finish
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č <mitr@redhat.com>
-rw-r--r--src/polkit/polkitauthority.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/polkit/polkitauthority.c b/src/polkit/polkitauthority.c
index 15a81ac..71d527c 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);