summaryrefslogtreecommitdiffstats
path: root/src/crypto/rsa/rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/rsa/rsa.c')
-rw-r--r--src/crypto/rsa/rsa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crypto/rsa/rsa.c b/src/crypto/rsa/rsa.c
index 5cc48ed..17059b0 100644
--- a/src/crypto/rsa/rsa.c
+++ b/src/crypto/rsa/rsa.c
@@ -121,7 +121,7 @@ void RSA_free(RSA *rsa) {
return;
}
- if (CRYPTO_add(&rsa->references, -1, CRYPTO_LOCK_RSA) > 0) {
+ if (!CRYPTO_refcount_dec_and_test_zero(&rsa->references)) {
return;
}
@@ -150,7 +150,7 @@ void RSA_free(RSA *rsa) {
}
int RSA_up_ref(RSA *rsa) {
- CRYPTO_add(&rsa->references, 1, CRYPTO_LOCK_RSA);
+ CRYPTO_refcount_inc(&rsa->references);
return 1;
}