summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/prng.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/crypto/prng.c')
-rw-r--r--src/lib/crypto/prng.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/crypto/prng.c b/src/lib/crypto/prng.c
index 338eaf0dd..7656a23aa 100644
--- a/src/lib/crypto/prng.c
+++ b/src/lib/crypto/prng.c
@@ -63,7 +63,7 @@ int krb5int_prng_init(void)
do_yarrow_init();
if (init_error)
return KRB5_CRYPTO_INTERNAL;
- return k5_mutex_finish_init(&yarrow_lock);
+ return 0;
}
static void do_yarrow_init(void)
@@ -71,6 +71,12 @@ static void do_yarrow_init(void)
unsigned i;
int yerr;
+ yerr = k5_mutex_finish_init(&yarrow_lock);
+ if (yerr) {
+ init_error = yerr;
+ return;
+ }
+
yerr = krb5int_yarrow_init (&y_ctx, NULL);
if ((yerr != YARROW_OK) && (yerr != YARROW_NOT_SEEDED)) {
init_error = yerr;