From: Luke Howard Date: Fri, 16 Sep 2011 22:10:21 +0000 (+1000) Subject: more cleanup of TLD X-Git-Tag: tr-beta1~94 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot.git;a=commitdiff_plain;h=57ca7c37e90acbcd8da6d215dc4f3c0edd7a88e5 more cleanup of TLD --- diff --git a/moonshot/mech_eap/display_status.c b/moonshot/mech_eap/display_status.c index 6eac550..fc0d1ab 100644 --- a/moonshot/mech_eap/display_status.c +++ b/moonshot/mech_eap/display_status.c @@ -64,7 +64,7 @@ gssEapDestroyStatusInfo(struct gss_eap_status_info *p) static void saveStatusInfoNoCopy(OM_uint32 minor, char *message) { - struct gss_eap_status_info **next = NULL, *p=NULL; + struct gss_eap_status_info **next = NULL, *p = NULL; struct gss_eap_thread_local_data *tld = gssEapGetThreadLocalData(); if (tld != NULL) { diff --git a/moonshot/mech_eap/util_krb.c b/moonshot/mech_eap/util_krb.c index 06da80e..8775c83 100644 --- a/moonshot/mech_eap/util_krb.c +++ b/moonshot/mech_eap/util_krb.c @@ -88,11 +88,16 @@ gssEapKerberosInit(OM_uint32 *minor, krb5_context *context) if (tld != NULL) { if (tld->krbContext == NULL) { *minor = initKrbContext(&tld->krbContext); - if (*minor == 0) - *context = tld->krbContext; + if (*minor != 0) + tld->krbContext = NULL; } + *context = tld->krbContext; + } else { + *minor = GSSEAP_GET_LAST_ERROR(); } + GSSEAP_ASSERT(*context != NULL || *minor != 0); + return (*minor == 0) ? GSS_S_COMPLETE : GSS_S_FAILURE; } diff --git a/moonshot/mech_eap/util_tld.c b/moonshot/mech_eap/util_tld.c index a30f5f3..10e3359 100644 --- a/moonshot/mech_eap/util_tld.c +++ b/moonshot/mech_eap/util_tld.c @@ -62,7 +62,13 @@ static DWORD tlsIndex; struct gss_eap_thread_local_data * gssEapGetThreadLocalData(void) { - return TlsGetValue(tlsIndex); + struct gss_eap_thread_local_data *tld; + + tld = TlsGetValue(tlsIndex); + + GSSEAP_ASSERT(tld != NULL); + + return tld; } BOOL WINAPI