diff options
author | Matt Caswell <matt@openssl.org> | 2016-02-29 14:07:28 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-02-29 14:07:28 +0100 |
commit | 174a74ef0b089b087023357b94548a60de0668f7 (patch) | |
tree | 9df00d1296a8b9491a9d31393e64336b0ff0e045 /test/asynctest.c | |
parent | Clarify ASYNC_WAIT_CTX_clear_fd() docs (diff) | |
download | openssl-174a74ef0b089b087023357b94548a60de0668f7.tar.xz openssl-174a74ef0b089b087023357b94548a60de0668f7.zip |
Fix use before init warnings in asynctest
If the tests fail early before an ASYNC_WAIT_CTX is created then there
can be a use before init problem in asynctest.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test/asynctest.c')
-rw-r--r-- | test/asynctest.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/asynctest.c b/test/asynctest.c index bfdf441e7c..31f04e92e4 100644 --- a/test/asynctest.c +++ b/test/asynctest.c @@ -139,7 +139,7 @@ static int test_ASYNC_init_thread() { ASYNC_JOB *job1 = NULL, *job2 = NULL, *job3 = NULL; int funcret1, funcret2, funcret3; - ASYNC_WAIT_CTX *waitctx; + ASYNC_WAIT_CTX *waitctx = NULL; if ( !ASYNC_init_thread(2, 0) || (waitctx = ASYNC_WAIT_CTX_new()) == NULL @@ -175,7 +175,7 @@ static int test_ASYNC_start_job() { ASYNC_JOB *job = NULL; int funcret; - ASYNC_WAIT_CTX *waitctx; + ASYNC_WAIT_CTX *waitctx = NULL; ctr = 0; @@ -203,7 +203,7 @@ static int test_ASYNC_get_current_job() { ASYNC_JOB *job = NULL; int funcret; - ASYNC_WAIT_CTX *waitctx; + ASYNC_WAIT_CTX *waitctx = NULL; currjob = NULL; @@ -230,7 +230,7 @@ static int test_ASYNC_WAIT_CTX_get_all_fds() { ASYNC_JOB *job = NULL; int funcret; - ASYNC_WAIT_CTX *waitctx; + ASYNC_WAIT_CTX *waitctx = NULL; OSSL_ASYNC_FD fd = OSSL_BAD_ASYNC_FD, delfd = OSSL_BAD_ASYNC_FD; size_t numfds, numdelfds; @@ -288,7 +288,7 @@ static int test_ASYNC_block_pause() { ASYNC_JOB *job = NULL; int funcret; - ASYNC_WAIT_CTX *waitctx; + ASYNC_WAIT_CTX *waitctx = NULL; if ( !ASYNC_init_thread(1, 0) || (waitctx = ASYNC_WAIT_CTX_new()) == NULL |