fix submitted by Andy Schneider <andy.schneider@bjss.co.uk>
[openssl.git] / crypto / cryptlib.c
index 4eb584c90a5855c7ca643e73889fb079b3dddb86..2f62fd77c64973e2fdde2feeb583117b8f35d6a7 100644 (file)
@@ -230,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_lock(CRYPTO_LOCK_DYNLOCK);
                return;
+               }
        pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
        if (pointer != NULL)
                {