diff options
author | Adam Langley <alangley@gmail.com> | 2015-05-15 22:49:30 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-05-20 22:15:26 +0300 |
commit | 0da323a8b8a4402f1c5d264cdc43c6b622118b67 (patch) | |
tree | f8d6f8775ff6253002ad18b60e52302fd391cdbd /crypto/evp | |
parent | 6f2e733bab69a5c853a929a96671736458b8d4c1 (diff) |
Convert reference counts in crypto/
This change converts the reference counts in crypto/ to use
|CRYPTO_refcount_t|. The reference counts in |X509_PKEY| and |X509_INFO|
were never actually used and so were dropped.
Change-Id: I75d572cdac1f8c1083c482e29c9519282d7fd16c
Reviewed-on: https://boringssl-review.googlesource.com/4772
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/evp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/evp/evp.c b/crypto/evp/evp.c index 58fd9a98..c4bfdac0 100644 --- a/crypto/evp/evp.c +++ b/crypto/evp/evp.c @@ -70,6 +70,7 @@ #include <openssl/thread.h> #include "internal.h" +#include "../internal.h" extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meth; @@ -106,7 +107,7 @@ void EVP_PKEY_free(EVP_PKEY *pkey) { return; } - if (CRYPTO_add(&pkey->references, -1, CRYPTO_LOCK_EVP_PKEY)) { + if (!CRYPTO_refcount_dec_and_test_zero(&pkey->references)) { return; } @@ -115,7 +116,7 @@ void EVP_PKEY_free(EVP_PKEY *pkey) { } EVP_PKEY *EVP_PKEY_up_ref(EVP_PKEY *pkey) { - CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY); + CRYPTO_refcount_inc(&pkey->references); return pkey; } |