From 7c34b0b06a708b217c3511b47e7c0d7afe67494b Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Sat, 17 Sep 2011 07:49:44 +1000 Subject: [PATCH] general cleanup of TLD init --- moonshot/mech_eap/util_krb.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/moonshot/mech_eap/util_krb.c b/moonshot/mech_eap/util_krb.c index ce3d0f6..06da80e 100644 --- a/moonshot/mech_eap/util_krb.c +++ b/moonshot/mech_eap/util_krb.c @@ -82,17 +82,18 @@ gssEapKerberosInit(OM_uint32 *minor, krb5_context *context) struct gss_eap_thread_local_data *tld; *minor = 0; + *context = NULL; tld = gssEapGetThreadLocalData(); if (tld != NULL) { - *context = tld->krbContext; - if (*context == NULL) { - *minor = initKrbContext(context); + if (tld->krbContext == NULL) { + *minor = initKrbContext(&tld->krbContext); if (*minor == 0) - tld->krbContext = *context; + *context = tld->krbContext; } } - return *minor == 0 ? GSS_S_COMPLETE : GSS_S_FAILURE; + + return (*minor == 0) ? GSS_S_COMPLETE : GSS_S_FAILURE; } /* -- 2.1.4