diff options
author | Richard Hughes <richard@hughsie.com> | 2010-08-10 15:52:12 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2010-08-10 15:52:12 +0100 |
commit | a4e099c5bff9f9fdb9067a0a6bb206d4c34745ae (patch) | |
tree | 077775602e1545e066c03a0eaf1153b6abbdcd25 /src | |
parent | 0660e5d20788ba0876400236965df87d8a789be3 (diff) |
Ensure we've initialized errors when calling into PolicyKit
Diffstat (limited to 'src')
-rw-r--r-- | src/up-polkit.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/up-polkit.c b/src/up-polkit.c index d7760dd..9b86394 100644 --- a/src/up-polkit.c +++ b/src/up-polkit.c @@ -69,11 +69,14 @@ up_polkit_check_auth (UpPolkit *polkit, PolkitSubject *subject, const gchar *act { gboolean ret = FALSE; GError *error; - GError *error_local; + GError *error_local = NULL; PolkitAuthorizationResult *result; /* check auth */ - result = polkit_authority_check_authorization_sync (polkit->priv->authority, subject, action_id, NULL, POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, NULL, &error_local); + result = polkit_authority_check_authorization_sync (polkit->priv->authority, + subject, action_id, NULL, + POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, + NULL, &error_local); if (result == NULL) { error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "failed to check authorisation: %s", error_local->message); dbus_g_method_return_error (context, error); @@ -104,11 +107,14 @@ up_polkit_is_allowed (UpPolkit *polkit, PolkitSubject *subject, const gchar *act { gboolean ret = FALSE; GError *error; - GError *error_local; + GError *error_local = NULL; PolkitAuthorizationResult *result; /* check auth */ - result = polkit_authority_check_authorization_sync (polkit->priv->authority, subject, action_id, NULL, POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE, NULL, &error_local); + result = polkit_authority_check_authorization_sync (polkit->priv->authority, + subject, action_id, NULL, + POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE, + NULL, &error_local); if (result == NULL) { error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "failed to check authorisation: %s", error_local->message); dbus_g_method_return_error (context, error); |