Skip to content

Commit

Permalink
Fix the fall-out in 04-test_bioprint.t
Browse files Browse the repository at this point in the history
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from openssl#3712)
  • Loading branch information
bernd-edlinger authored and Rich Salz committed Jun 19, 2017
1 parent af6de40 commit 3ac6d5e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crypto/init.c
Expand Up @@ -43,7 +43,10 @@ static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc)

if (local == NULL && alloc) {
local = OPENSSL_zalloc(sizeof *local);
CRYPTO_THREAD_set_local(&threadstopkey, local);
if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {
OPENSSL_free(local);
return NULL;
}
}
if (!alloc) {
CRYPTO_THREAD_set_local(&threadstopkey, NULL);
Expand Down Expand Up @@ -359,7 +362,12 @@ void OPENSSL_thread_stop(void)

int ossl_init_thread_start(uint64_t opts)
{
struct thread_local_inits_st *locals = ossl_init_get_thread_local(1);
struct thread_local_inits_st *locals;

if (!OPENSSL_init_crypto(0, NULL))
return 0;

locals = ossl_init_get_thread_local(1);

if (locals == NULL)
return 0;
Expand Down

0 comments on commit 3ac6d5e

Please sign in to comment.