engines/e_dasync.c:510: error: MEMORY_LEAK
  memory dynamically allocated to `writefd` by call to `CRYPTO_malloc()` at line 466, column 19 is not reachable after line 510, column 1.
Showing all 46 steps of the trace


engines/e_dasync.c:445:1: start of procedure dummy_pause_job()
443.   #define DUMMY_CHAR 'X'
444.   
445. > static void dummy_pause_job(void) {
446.       ASYNC_JOB *job;
447.       ASYNC_WAIT_CTX *waitctx;

engines/e_dasync.c:448:5: 
446.       ASYNC_JOB *job;
447.       ASYNC_WAIT_CTX *waitctx;
448. >     OSSL_ASYNC_FD pipefds[2] = {0, 0};
449.       OSSL_ASYNC_FD *writefd;
450.   #if defined(ASYNC_WIN)

engines/e_dasync.c:454:5: 
452.       char buf = DUMMY_CHAR;
453.   #elif defined(ASYNC_POSIX)
454. >     char buf = DUMMY_CHAR;
455.   #endif
456.   

engines/e_dasync.c:457:9: 
455.   #endif
456.   
457. >     if ((job = ASYNC_get_current_job()) == NULL)
458.           return;
459.   

crypto/async/async.c:438:1: start of procedure ASYNC_get_current_job()
  436.   }
  437.   
  438. > ASYNC_JOB *ASYNC_get_current_job(void)
  439.   {
  440.       async_ctx *ctx;

crypto/async/async.c:442:5: 
  440.       async_ctx *ctx;
  441.   
  442. >     ctx = async_get_ctx();
  443.       if(ctx == NULL)
  444.           return NULL;

crypto/async/async.c:102:1: start of procedure async_get_ctx()
    100.   }
    101.   
    102. > async_ctx *async_get_ctx(void)
    103.   {
    104.       if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL))

crypto/async/async.c:104:10: Taking false branch
    102.   async_ctx *async_get_ctx(void)
    103.   {
    104.       if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL))
                    ^
    105.           return NULL;
    106.   

crypto/async/async.c:107:5: 
    105.           return NULL;
    106.   
    107. >     return (async_ctx *)CRYPTO_THREAD_get_local(&ctxkey);
    108.   }
    109.   

crypto/threads_pthread.c:120:1: start of procedure CRYPTO_THREAD_get_local()
      118.   }
      119.   
      120. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
      121.   {
      122.       return pthread_getspecific(*key);

crypto/threads_pthread.c:122:5: Skipping pthread_getspecific(): method has no implementation
      120.   void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
      121.   {
      122.       return pthread_getspecific(*key);
                 ^
      123.   }
      124.   

crypto/threads_pthread.c:123:1: return from a call to CRYPTO_THREAD_get_local
      121.   {
      122.       return pthread_getspecific(*key);
      123. > }
      124.   
      125.   int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)

crypto/async/async.c:108:1: return from a call to async_get_ctx
    106.   
    107.       return (async_ctx *)CRYPTO_THREAD_get_local(&ctxkey);
    108. > }
    109.   
    110.   static int async_ctx_free(void)

crypto/async/async.c:443:8: Taking false branch
  441.   
  442.       ctx = async_get_ctx();
  443.       if(ctx == NULL)
                ^
  444.           return NULL;
  445.   

crypto/async/async.c:446:5: 
  444.           return NULL;
  445.   
  446. >     return ctx->currjob;
  447.   }
  448.   

crypto/async/async.c:447:1: return from a call to ASYNC_get_current_job
  445.   
  446.       return ctx->currjob;
  447. > }
  448.   
  449.   ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job)

engines/e_dasync.c:457:9: Taking false branch
455.   #endif
456.   
457.       if ((job = ASYNC_get_current_job()) == NULL)
               ^
458.           return;
459.   

engines/e_dasync.c:460:5: 
458.           return;
459.   
460. >     waitctx = ASYNC_get_wait_ctx(job);
461.   
462.       if (ASYNC_WAIT_CTX_get_fd(waitctx, engine_dasync_id, &pipefds[0],

crypto/async/async.c:449:1: start of procedure ASYNC_get_wait_ctx()
  447.   }
  448.   
  449. > ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job)
  450.   {
  451.       return job->waitctx;

crypto/async/async.c:451:5: 
  449.   ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job)
  450.   {
  451. >     return job->waitctx;
  452.   }
  453.   

crypto/async/async.c:452:1: return from a call to ASYNC_get_wait_ctx
  450.   {
  451.       return job->waitctx;
  452. > }
  453.   
  454.   void ASYNC_block_pause(void)

engines/e_dasync.c:462:9: 
460.       waitctx = ASYNC_get_wait_ctx(job);
461.   
462. >     if (ASYNC_WAIT_CTX_get_fd(waitctx, engine_dasync_id, &pipefds[0],
463.                                 (void **)&writefd)) {
464.           pipefds[1] = *writefd;

crypto/async/async_wait.c:106:1: start of procedure ASYNC_WAIT_CTX_get_fd()
  104.   }
  105.   
  106. > int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key,
  107.                             OSSL_ASYNC_FD *fd, void **custom_data)
  108.   {

crypto/async/async_wait.c:111:5: 
  109.       struct fd_lookup_st *curr;
  110.   
  111. >     curr = ctx->fds;
  112.       while (curr != NULL) {
  113.           if (curr->del) {

crypto/async/async_wait.c:112:12: Loop condition is false. Leaving loop
  110.   
  111.       curr = ctx->fds;
  112.       while (curr != NULL) {
                    ^
  113.           if (curr->del) {
  114.               /* This one has been marked deleted so do nothing */

crypto/async/async_wait.c:125:5: 
  123.           curr = curr->next;
  124.       }
  125. >     return 0;
  126.   }
  127.   

crypto/async/async_wait.c:126:1: return from a call to ASYNC_WAIT_CTX_get_fd
  124.       }
  125.       return 0;
  126. > }
  127.   
  128.   int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd,

engines/e_dasync.c:462:9: Taking false branch
460.       waitctx = ASYNC_get_wait_ctx(job);
461.   
462.       if (ASYNC_WAIT_CTX_get_fd(waitctx, engine_dasync_id, &pipefds[0],
               ^
463.                                 (void **)&writefd)) {
464.           pipefds[1] = *writefd;

engines/e_dasync.c:466:9: 
464.           pipefds[1] = *writefd;
465.       } else {
466. >         writefd = OPENSSL_malloc(sizeof(*writefd));
467.           if (writefd == NULL)
468.               return;

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 (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
  121.       void *ret = NULL;
  122.   
  123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  124.           return malloc_impl(num, file, line);
  125.   

crypto/mem.c:126:9: Taking false branch
  124.           return malloc_impl(num, file, line);
  125.   
  126.       if (num <= 0)
                 ^
  127.           return NULL;
  128.   

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

crypto/mem.c:139:5: 
  137.       }
  138.   #else
  139. >     osslargused(file); osslargused(line);
  140.       ret = malloc(num);
  141.   #endif

crypto/mem.c:139:24: 
  137.       }
  138.   #else
  139. >     osslargused(file); osslargused(line);
  140.       ret = malloc(num);
  141.   #endif

crypto/mem.c:140:5: 
  138.   #else
  139.       osslargused(file); osslargused(line);
  140. >     ret = malloc(num);
  141.   #endif
  142.   

crypto/mem.c:143:5: 
  141.   #endif
  142.   
  143. >     return ret;
  144.   }
  145.   

crypto/mem.c:144:1: return from a call to CRYPTO_malloc
  142.   
  143.       return ret;
  144. > }
  145.   
  146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

engines/e_dasync.c:467:13: Taking false branch
465.       } else {
466.           writefd = OPENSSL_malloc(sizeof(*writefd));
467.           if (writefd == NULL)
                   ^
468.               return;
469.   #if defined(ASYNC_WIN)

engines/e_dasync.c:475:13: Taking false branch
473.           }
474.   #elif defined(ASYNC_POSIX)
475.           if (pipe(pipefds) != 0) {
                   ^
476.               OPENSSL_free(writefd);
477.               return;

engines/e_dasync.c:480:9: 
478.           }
479.   #endif
480. >         *writefd = pipefds[1];
481.   
482.           if(!ASYNC_WAIT_CTX_set_wait_fd(waitctx, engine_dasync_id, pipefds[0],

engines/e_dasync.c:482:13: Taking false branch
480.           *writefd = pipefds[1];
481.   
482.           if(!ASYNC_WAIT_CTX_set_wait_fd(waitctx, engine_dasync_id, pipefds[0],
                   ^
483.                                          writefd, wait_cleanup)) {
484.               wait_cleanup(waitctx, engine_dasync_id, pipefds[0], writefd);

engines/e_dasync.c:496:9: Taking true branch
494.       WriteFile(pipefds[1], &buf, 1, &numwritten, NULL);
495.   #elif defined(ASYNC_POSIX)
496.       if (write(pipefds[1], &buf, 1) < 0)
               ^
497.           return;
498.   #endif

engines/e_dasync.c:497:9: 
495.   #elif defined(ASYNC_POSIX)
496.       if (write(pipefds[1], &buf, 1) < 0)
497. >         return;
498.   #endif
499.   

engines/e_dasync.c:510:1: return from a call to dummy_pause_job
508.           return;
509.   #endif
510. > }
511.   
512.   /*
