aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/err/err.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2006-06-14 08:55:23 +0000
committerBodo Möller <bodo@openssl.org>2006-06-14 08:55:23 +0000
commit675f605d44630d491f10c846344679e8fc90b119 (patch)
tree0931cdd93ee98c003ccd360544851185c271034c /crypto/err/err.c
parent6a983d4287e315105551ac84c82868c6f83a0de7 (diff)
downloadopenssl-675f605d44630d491f10c846344679e8fc90b119.tar.gz
Thread-safety fixes
Diffstat (limited to 'crypto/err/err.c')
-rw-r--r--crypto/err/err.c15
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++)
{