diff options
Diffstat (limited to 'src/crypto/ec/ec_key.c')
-rw-r--r-- | src/crypto/ec/ec_key.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/crypto/ec/ec_key.c b/src/crypto/ec/ec_key.c index 348ec46..e5cbfed 100644 --- a/src/crypto/ec/ec_key.c +++ b/src/crypto/ec/ec_key.c @@ -143,7 +143,7 @@ void EC_KEY_free(EC_KEY *r) { return; } - if (CRYPTO_add(&r->references, -1, CRYPTO_LOCK_EC)) { + if (!CRYPTO_refcount_dec_and_test_zero(&r->references)) { return; } @@ -234,7 +234,8 @@ EC_KEY *EC_KEY_dup(const EC_KEY *ec_key) { } int EC_KEY_up_ref(EC_KEY *r) { - return CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC) > 1; + CRYPTO_refcount_inc(&r->references); + return 1; } int EC_KEY_is_opaque(const EC_KEY *key) { |