crypto/async/async.c:153: error: NULL_DEREFERENCE
  pointer `ctx` last assigned on line 149 could be null and is dereferenced at line 153, column 15.
Showing all 8 steps of the trace


crypto/async/async.c:146:1: start of procedure async_start_func()
144.   }
145.   
146. > void async_start_func(void)
147.   {
148.       ASYNC_JOB *job;

crypto/async/async.c:149:5: 
147.   {
148.       ASYNC_JOB *job;
149. >     async_ctx *ctx = async_get_ctx();
150.   
151.       while (1) {

crypto/async/async.c:58:1: start of procedure async_get_ctx()
  56.   }
  57.   
  58. > async_ctx *async_get_ctx(void)
  59.   {
  60.       if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL))

crypto/async/async.c:60:10: Taking true branch
  58.   async_ctx *async_get_ctx(void)
  59.   {
  60.       if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL))
                 ^
  61.           return NULL;
  62.   

crypto/async/async.c:61:9: 
  59.   {
  60.       if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL))
  61. >         return NULL;
  62.   
  63.       return (async_ctx *)CRYPTO_THREAD_get_local(&ctxkey);

crypto/async/async.c:64:1: return from a call to async_get_ctx
  62.   
  63.       return (async_ctx *)CRYPTO_THREAD_get_local(&ctxkey);
  64. > }
  65.   
  66.   static int async_ctx_free(void)

crypto/async/async.c:151:12: Loop condition is true. Entering loop body
149.       async_ctx *ctx = async_get_ctx();
150.   
151.       while (1) {
                  ^
152.           /* Run the job */
153.           job = ctx->currjob;

crypto/async/async.c:153:9: 
151.       while (1) {
152.           /* Run the job */
153. >         job = ctx->currjob;
154.           job->ret = job->func(job->funcargs);
155.   

void async_start_func(void)
{
    ASYNC_JOB *job;
    async_ctx *ctx = async_get_ctx();
    while (1) {
        job = ctx->currjob;
        job->ret = job->func(job->funcargs);
        job->status = ASYNC_JOB_STOPPING;
        if (!async_fibre_swapcontext(&job->fibrectx,
                                     &ctx->dispatcher, 1)) {
            ASYNCerr(ASYNC_F_ASYNC_START_FUNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT);
        }
    }
}
['void async_start_func(void)\n{\n    ASYNC_JOB *job;\n    async_ctx *ctx = async_get_ctx();\n    while (1) {\n        job = ctx->currjob;\n        job->ret = job->func(job->funcargs);\n        job->status = ASYNC_JOB_STOPPING;\n        if (!async_fibre_swapcontext(&job->fibrectx,\n                                     &ctx->dispatcher, 1)) {\n            ASYNCerr(ASYNC_F_ASYNC_START_FUNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT);\n        }\n    }\n}', 'async_ctx *async_get_ctx(void)\n{\n    if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL))\n        return NULL;\n    return (async_ctx *)CRYPTO_THREAD_get_local(&ctxkey);\n}']