crypto/async/async.c:274: error: MEMORY_LEAK
  memory dynamically allocated to `return` by call to `async_ctx_new()` at line 226, column 15 is not reachable after line 274, column 13.
Showing all 32 steps of the trace


crypto/async/async.c:221:1: start of procedure ASYNC_start_job()
219.   }
220.   
221. > int ASYNC_start_job(ASYNC_JOB **job, int *ret, int (*func)(void *),
222.                            void *args, size_t size)
223.   {

crypto/async/async.c:224:5: 
222.                            void *args, size_t size)
223.   {
224. >     async_ctx *ctx = async_get_ctx();
225.       if (ctx == NULL)
226.           ctx = async_ctx_new();

crypto/async/async.c:98:1: start of procedure async_get_ctx()
  96.   }
  97.   
  98. > static async_ctx *async_get_ctx(void)
  99.   {
  100.       OPENSSL_INIT_crypto_library_start(OPENSSL_INIT_ASYNC, NULL);

crypto/async/async.c:100:5: Skipping OPENSSL_INIT_crypto_library_start(): empty list of specs
  98.   static async_ctx *async_get_ctx(void)
  99.   {
  100.       OPENSSL_INIT_crypto_library_start(OPENSSL_INIT_ASYNC, NULL);
             ^
  101.       return async_arch_get_ctx();
  102.   }

crypto/async/async.c:101:5: Skipping pthread_getspecific(): method has no implementation
  99.   {
  100.       OPENSSL_INIT_crypto_library_start(OPENSSL_INIT_ASYNC, NULL);
  101.       return async_arch_get_ctx();
             ^
  102.   }
  103.   

crypto/async/async.c:102:1: return from a call to async_get_ctx
  100.       OPENSSL_INIT_crypto_library_start(OPENSSL_INIT_ASYNC, NULL);
  101.       return async_arch_get_ctx();
  102. > }
  103.   
  104.   static int async_ctx_free(void)

crypto/async/async.c:225:9: Taking true branch
223.   {
224.       async_ctx *ctx = async_get_ctx();
225.       if (ctx == NULL)
               ^
226.           ctx = async_ctx_new();
227.       if (ctx == NULL) {

crypto/async/async.c:226:9: 
224.       async_ctx *ctx = async_get_ctx();
225.       if (ctx == NULL)
226. >         ctx = async_ctx_new();
227.       if (ctx == NULL) {
228.           return ASYNC_ERR;

crypto/async/async.c:75:1: start of procedure async_ctx_new()
  73.   static void async_free_pool_internal(async_pool *pool);
  74.   
  75. > static async_ctx *async_ctx_new(void)
  76.   {
  77.       async_ctx *nctx = NULL;

crypto/async/async.c:77:5: 
  75.   static async_ctx *async_ctx_new(void)
  76.   {
  77. >     async_ctx *nctx = NULL;
  78.   
  79.       nctx = OPENSSL_malloc(sizeof (async_ctx));

crypto/async/async.c:79:5: 
  77.       async_ctx *nctx = NULL;
  78.   
  79. >     nctx = OPENSSL_malloc(sizeof (async_ctx));
  80.       if (nctx == NULL) {
  81.           ASYNCerr(ASYNC_F_ASYNC_CTX_NEW, ERR_R_MALLOC_FAILURE);

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
    117.   }
    118.   
    119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121.       void *ret = NULL;

crypto/mem.c:121:5: 
    119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121. >     void *ret = NULL;
    122.   
    123.       if (num <= 0)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (num <= 0)
                   ^
    124.           return NULL;
    125.   

crypto/mem.c:126:5: 
    124.           return NULL;
    125.   
    126. >     allow_customize = 0;
    127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
    134.       }
    135.   #else
    136. >     (void)file;
    137.       (void)line;
    138.       ret = malloc(num);

crypto/mem.c:137:5: 
    135.   #else
    136.       (void)file;
    137. >     (void)line;
    138.       ret = malloc(num);
    139.   #endif

crypto/mem.c:138:5: 
    136.       (void)file;
    137.       (void)line;
    138. >     ret = malloc(num);
    139.   #endif
    140.   

crypto/mem.c:153:5: 
    151.   #endif
    152.   
    153. >     return ret;
    154.   }
    155.   

crypto/mem.c:154:1: return from a call to CRYPTO_malloc
    152.   
    153.       return ret;
    154. > }
    155.   
    156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/async/async.c:80:9: Taking false branch
  78.   
  79.       nctx = OPENSSL_malloc(sizeof (async_ctx));
  80.       if (nctx == NULL) {
                ^
  81.           ASYNCerr(ASYNC_F_ASYNC_CTX_NEW, ERR_R_MALLOC_FAILURE);
  82.           goto err;

crypto/async/async.c:86:5: 
  84.   
  85.       async_fibre_init_dispatcher(&nctx->dispatcher);
  86. >     nctx->currjob = NULL;
  87.       nctx->blocked = 0;
  88.       if (!async_set_ctx(nctx))

crypto/async/async.c:87:5: 
  85.       async_fibre_init_dispatcher(&nctx->dispatcher);
  86.       nctx->currjob = NULL;
  87. >     nctx->blocked = 0;
  88.       if (!async_set_ctx(nctx))
  89.           goto err;

crypto/async/async.c:88:10: Taking false branch
  86.       nctx->currjob = NULL;
  87.       nctx->blocked = 0;
  88.       if (!async_set_ctx(nctx))
                 ^
  89.           goto err;
  90.   

crypto/async/async.c:91:5: 
  89.           goto err;
  90.   
  91. >     return nctx;
  92.   err:
  93.       OPENSSL_free(nctx);

crypto/async/async.c:96:1: return from a call to async_ctx_new
  94.   
  95.       return NULL;
  96. > }
  97.   
  98.   static async_ctx *async_get_ctx(void)

crypto/async/async.c:227:9: Taking false branch
225.       if (ctx == NULL)
226.           ctx = async_ctx_new();
227.       if (ctx == NULL) {
               ^
228.           return ASYNC_ERR;
229.       }

crypto/async/async.c:231:9: Taking false branch
229.       }
230.   
231.       if (*job) {
               ^
232.           ctx->currjob = *job;
233.       }

crypto/async/async.c:296:5: Loop condition is true. Entering loop body
294.               goto err;
295.           }
296.       }
           ^
297.   
298.   err:

crypto/async/async.c:236:13: Taking false branch
234.   
235.       for (;;) {
236.           if (ctx->currjob != NULL) {
                   ^
237.               if (ctx->currjob->status == ASYNC_JOB_STOPPING) {
238.                   *ret = ctx->currjob->ret;

crypto/async/async.c:273:13: Taking true branch
271.   
272.           /* Start a new job */
273.           if ((ctx->currjob = async_get_pool_job()) == NULL) {
                   ^
274.               return ASYNC_NO_JOBS;
275.           }

crypto/async/async.c:274:13: 
272.           /* Start a new job */
273.           if ((ctx->currjob = async_get_pool_job()) == NULL) {
274. >             return ASYNC_NO_JOBS;
275.           }
276.   
