lock creds in right spot in accept_sec_context
authorLuke Howard <lukeh@padl.com>
Wed, 29 Sep 2010 13:09:20 +0000 (15:09 +0200)
committerLuke Howard <lukeh@padl.com>
Wed, 29 Sep 2010 13:09:20 +0000 (15:09 +0200)
accept_sec_context.c

index 184109c..8b98484 100644 (file)
@@ -521,11 +521,12 @@ gss_accept_sec_context(OM_uint32 *minor,
 
     /* Validate and lock credentials */
     if (cred != GSS_C_NO_CREDENTIAL) {
+        GSSEAP_MUTEX_LOCK(&cred->mutex);
+
         if ((cred->flags & CRED_FLAG_ACCEPT) == 0) {
             major = GSS_S_NO_CRED;
             goto cleanup;
         }
-        GSSEAP_MUTEX_LOCK(&cred->mutex);
     }
 
     sm = &eapGssAcceptorSm[ctx->state];