summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2009-10-08 21:41:32 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2009-10-08 21:41:32 +0000
commit0087fe8c6ad07fcb7915c76163a5e9f1b111b22f (patch)
tree077b5a17190e7c4b7e395e430da5b128d29ef9b4 /lib
parent5f2656418b5916161486ca1552a05ddd685b5d24 (diff)
simplify error handling
Diffstat (limited to 'lib')
-rw-r--r--lib/ZMkAuth.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/ZMkAuth.c b/lib/ZMkAuth.c
index 6e8984d..0a39487 100644
--- a/lib/ZMkAuth.c
+++ b/lib/ZMkAuth.c
@@ -229,13 +229,9 @@ ZGetCredsRealm(krb5_creds **creds_out,
}
result = krb5_cc_get_principal(Z_krb5_ctx, ccache, &creds_in.client);
- if (result) {
- krb5_free_cred_contents(Z_krb5_ctx, &creds_in); /* I also hope this is ok */
- krb5_cc_close(Z_krb5_ctx, ccache);
- return result;
- }
+ if (!result)
+ result = krb5_get_credentials(Z_krb5_ctx, 0, ccache, &creds_in, creds_out);
- result = krb5_get_credentials(Z_krb5_ctx, 0, ccache, &creds_in, creds_out);
krb5_cc_close(Z_krb5_ctx, ccache);
krb5_free_cred_contents(Z_krb5_ctx, &creds_in); /* I also hope this is ok */