summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cryptlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/cryptlib.c')
-rw-r--r--src/lib/libcrypto/cryptlib.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c
index 9de60fd528..a7a9262133 100644
--- a/src/lib/libcrypto/cryptlib.c
+++ b/src/lib/libcrypto/cryptlib.c
@@ -241,7 +241,7 @@ void CRYPTO_destroy_dynlockid(int i)
241 } 241 }
242 else 242 else
243#endif 243#endif
244 if (--(pointer->references) <= 0) 244 if (pointer->references <= 0)
245 { 245 {
246 sk_CRYPTO_dynlock_set(dyn_locks, i, NULL); 246 sk_CRYPTO_dynlock_set(dyn_locks, i, NULL);
247 } 247 }
@@ -396,16 +396,15 @@ void CRYPTO_lock(int mode, int type, const char *file, int line)
396#endif 396#endif
397 if (type < 0) 397 if (type < 0)
398 { 398 {
399 int i = -type - 1;
400 struct CRYPTO_dynlock_value *pointer 399 struct CRYPTO_dynlock_value *pointer
401 = CRYPTO_get_dynlock_value(i); 400 = CRYPTO_get_dynlock_value(type);
402 401
403 if (pointer) 402 if (pointer && dynlock_lock_callback)
404 { 403 {
405 dynlock_lock_callback(mode, pointer, file, line); 404 dynlock_lock_callback(mode, pointer, file, line);
406 } 405 }
407 406
408 CRYPTO_destroy_dynlockid(i); 407 CRYPTO_destroy_dynlockid(type);
409 } 408 }
410 else 409 else
411 if (locking_callback != NULL) 410 if (locking_callback != NULL)
@@ -431,7 +430,6 @@ int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
431 CRYPTO_get_lock_name(type), 430 CRYPTO_get_lock_name(type),
432 file,line); 431 file,line);
433#endif 432#endif
434 *pointer=ret;
435 } 433 }
436 else 434 else
437 { 435 {