From: zacheiss Date: Mon, 19 Aug 2002 17:42:45 +0000 (+0000) Subject: Use krb5_error_code for return value of krb5 library functions. Reset X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/a2b41ee998b4640f3f2c60b8d34196a078873920 Use krb5_error_code for return value of krb5 library functions. Reset auth_con to NULL after freeing since it's global. --- diff --git a/lib/mr_auth.c b/lib/mr_auth.c index 6398163c..fccf5f51 100644 --- a/lib/mr_auth.c +++ b/lib/mr_auth.c @@ -102,6 +102,7 @@ int mr_krb5_auth(char *prog) int argl[2]; krb5_ccache ccache = NULL; krb5_data auth; + krb5_error_code problem; CHECK_CONNECTED; @@ -118,21 +119,21 @@ int mr_krb5_auth(char *prog) *p = '\0'; if (!context) - status = krb5_init_context(&context); - if (status) + problem = krb5_init_context(&context); + if (problem) goto out; - status = krb5_auth_con_init(context, &auth_con); - if (status) + problem = krb5_auth_con_init(context, &auth_con); + if (problem) goto out; - status = krb5_cc_default(context, &ccache); - if (status) + problem = krb5_cc_default(context, &ccache); + if (problem) goto out; - status = krb5_mk_req(context, &auth_con, NULL, MOIRA_SNAME, host, NULL, + problem = krb5_mk_req(context, &auth_con, NULL, MOIRA_SNAME, host, NULL, ccache, &auth); - if (status) + if (problem) goto out; params.u.mr_procno = MR_KRB5_AUTH; @@ -155,6 +156,7 @@ int mr_krb5_auth(char *prog) krb5_free_data_contents(context, &auth); if (auth_con) krb5_auth_con_free(context, auth_con); + auth_con = NULL; return status; }