diff options
author | djm <> | 2012-10-13 21:25:14 +0000 |
---|---|---|
committer | djm <> | 2012-10-13 21:25:14 +0000 |
commit | 942650cdef05a877200cb7aff3a075935a5fd0cd (patch) | |
tree | 281e0a29ae8f87a8c47fbd4deaa1f3d48b8cc5c1 /src/lib/libcrypto/asn1/x_pubkey.c | |
parent | 37f091539f73e1650c83acd0c78677ef48c209a6 (diff) | |
download | openbsd-942650cdef05a877200cb7aff3a075935a5fd0cd.tar.gz openbsd-942650cdef05a877200cb7aff3a075935a5fd0cd.tar.bz2 openbsd-942650cdef05a877200cb7aff3a075935a5fd0cd.zip |
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/asn1/x_pubkey.c')
-rw-r--r-- | src/lib/libcrypto/asn1/x_pubkey.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/x_pubkey.c b/src/lib/libcrypto/asn1/x_pubkey.c index d42b6a2c54..627ec87f9f 100644 --- a/src/lib/libcrypto/asn1/x_pubkey.c +++ b/src/lib/libcrypto/asn1/x_pubkey.c | |||
@@ -171,7 +171,16 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) | |||
171 | goto error; | 171 | goto error; |
172 | } | 172 | } |
173 | 173 | ||
174 | key->pkey = ret; | 174 | /* Check to see if another thread set key->pkey first */ |
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); | ||
175 | CRYPTO_add(&ret->references, 1, CRYPTO_LOCK_EVP_PKEY); | 184 | CRYPTO_add(&ret->references, 1, CRYPTO_LOCK_EVP_PKEY); |
176 | 185 | ||
177 | return ret; | 186 | return ret; |