From 0087fe8c6ad07fcb7915c76163a5e9f1b111b22f Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Thu, 8 Oct 2009 21:41:32 +0000 Subject: simplify error handling --- lib/ZMkAuth.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib') 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 */ -- cgit v1.2.3