diff options
author | Bodo Möller <bodo@openssl.org> | 2006-06-14 08:55:23 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2006-06-14 08:55:23 +0000 |
commit | 675f605d44630d491f10c846344679e8fc90b119 (patch) | |
tree | 0931cdd93ee98c003ccd360544851185c271034c /crypto/err/err.c | |
parent | 6a983d4287e315105551ac84c82868c6f83a0de7 (diff) | |
download | openssl-675f605d44630d491f10c846344679e8fc90b119.tar.gz |
Thread-safety fixes
Diffstat (limited to 'crypto/err/err.c')
-rw-r--r-- | crypto/err/err.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c index 84741326ac..3367a75d99 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -550,9 +550,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++) { |