Implement failover for ubsec. Submitted by Subramanian Ramamoorthy
[openssl.git] / crypto / cryptlib.c
index 6a2e546fba99300f02ed570b81750067cfd498fb..612b3b93b447b38180f411a1d11d243f086189b1 100644 (file)
@@ -74,7 +74,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
        {
        "<<ERROR>>",
        "err",
-       "err_hash",
+       "ex_data",
        "x509",
        "x509_info",
        "x509_pkey",
@@ -103,8 +103,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
        "dynlock",
        "engine",
        "ui",
-       "ex_data",
-#if CRYPTO_NUM_LOCKS != 32
+#if CRYPTO_NUM_LOCKS != 31
 # error "Inconsistency between crypto.h and cryptlib.c"
 #endif
        };
@@ -231,7 +230,10 @@ void CRYPTO_destroy_dynlockid(int i)
        CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
 
        if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks))
+               {
+               CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
                return;
+               }
        pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
        if (pointer != NULL)
                {