HEADS UP: move dictionary file to $prefix/etc/raddb/dictionary
[mech_eap.orig] / delete_sec_context.c
index 75b09f1..7bd9cfb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, JANET(UK)
+ * Copyright (c) 2011, JANET(UK)
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * SUCH DAMAGE.
  */
 
+/*
+ * Release a context handle.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
@@ -65,8 +69,10 @@ gss_delete_sec_context(OM_uint32 *minor,
 
         major = gssEapWrapOrGetMIC(minor, ctx, FALSE, FALSE,
                                    iov, 2, TOK_TYPE_DELETE_CONTEXT);
-        if (GSS_ERROR(major))
+        if (GSS_ERROR(major)) {
+            GSSEAP_MUTEX_UNLOCK(&ctx->mutex);
             return major;
+        }
     }
 
     GSSEAP_MUTEX_UNLOCK(&ctx->mutex);