diff options
author | Richard Levitte <levitte@openssl.org> | 2001-06-01 15:22:22 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2001-06-01 15:22:22 +0000 |
commit | 5c36f01000e38d11465259f81fc3c052d00d52e8 (patch) | |
tree | d385a878a0c0c1d1a8bbf13e359297f246cf67da | |
parent | 6ef9d8328bd09d3b6a19be83bf46724c806cb1ce (diff) | |
download | openssl-5c36f01000e38d11465259f81fc3c052d00d52e8.tar.gz |
Stop mishandling the type number in dynlock locking
-rw-r--r-- | crypto/cryptlib.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 9de60fd528..48ce8c28ab 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -241,7 +241,7 @@ void CRYPTO_destroy_dynlockid(int i) } else #endif - if (--(pointer->references) <= 0) + if (pointer->references <= 0) { sk_CRYPTO_dynlock_set(dyn_locks, i, NULL); } @@ -396,16 +396,15 @@ void CRYPTO_lock(int mode, int type, const char *file, int line) #endif if (type < 0) { - int i = -type - 1; struct CRYPTO_dynlock_value *pointer - = CRYPTO_get_dynlock_value(i); + = CRYPTO_get_dynlock_value(type); - if (pointer) + if (pointer && dynlock_lock_callback) { dynlock_lock_callback(mode, pointer, file, line); } - CRYPTO_destroy_dynlockid(i); + CRYPTO_destroy_dynlockid(type); } else if (locking_callback != NULL) |