diff options
Diffstat (limited to 'openssl/trunk/crypto/err/err.c')
-rw-r--r-- | openssl/trunk/crypto/err/err.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/openssl/trunk/crypto/err/err.c b/openssl/trunk/crypto/err/err.c index 72e3f3a2..96bd255e 100644 --- a/openssl/trunk/crypto/err/err.c +++ b/openssl/trunk/crypto/err/err.c @@ -548,9 +548,20 @@ static void build_SYS_str_reasons(void) int i; static int init = 1; - if (!init) return; - + CRYPTO_r_lock(CRYPTO_LOCK_ERR); + if (!init) + { + CRYPTO_r_unlock(CRYPTO_LOCK_ERR); + return; + } + + CRYPTO_r_unlock(CRYPTO_LOCK_ERR); CRYPTO_w_lock(CRYPTO_LOCK_ERR); + if (!init) + { + CRYPTO_w_unlock(CRYPTO_LOCK_ERR); + return; + } for (i = 1; i <= NUM_SYS_STR_REASONS; i++) { |