diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/x_pubkey.c')
| -rw-r--r-- | src/lib/libcrypto/asn1/x_pubkey.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/lib/libcrypto/asn1/x_pubkey.c b/src/lib/libcrypto/asn1/x_pubkey.c index 627ec87f9f..d42b6a2c54 100644 --- a/src/lib/libcrypto/asn1/x_pubkey.c +++ b/src/lib/libcrypto/asn1/x_pubkey.c | |||
| @@ -171,16 +171,7 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) | |||
| 171 | goto error; | 171 | goto error; |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | /* Check to see if another thread set key->pkey first */ | 174 | key->pkey = ret; |
| 175 | CRYPTO_w_lock(CRYPTO_LOCK_EVP_PKEY); | ||
| 176 | if (key->pkey) | ||
| 177 | { | ||
| 178 | EVP_PKEY_free(ret); | ||
| 179 | ret = key->pkey; | ||
| 180 | } | ||
| 181 | else | ||
| 182 | key->pkey = ret; | ||
| 183 | CRYPTO_w_unlock(CRYPTO_LOCK_EVP_PKEY); | ||
| 184 | CRYPTO_add(&ret->references, 1, CRYPTO_LOCK_EVP_PKEY); | 175 | CRYPTO_add(&ret->references, 1, CRYPTO_LOCK_EVP_PKEY); |
| 185 | 176 | ||
| 186 | return ret; | 177 | return ret; |
