crypto/err/err.c:697: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_zalloc()` at line 691, column 17 is not reachable after line 697, column 13.
Showing all 39 steps of the trace


crypto/err/err.c:681:1: start of procedure ERR_get_state()
679.   }
680.   
681. > ERR_STATE *ERR_get_state(void)
682.   {
683.       ERR_STATE *state = NULL;

crypto/err/err.c:683:5: 
681.   ERR_STATE *ERR_get_state(void)
682.   {
683. >     ERR_STATE *state = NULL;
684.   
685.       if (!RUN_ONCE(&err_init, err_do_init))

crypto/err/err.c:685:10: 
683.       ERR_STATE *state = NULL;
684.   
685. >     if (!RUN_ONCE(&err_init, err_do_init))
686.           return NULL;
687.   

crypto/threads_pthread.c:105:1: start of procedure CRYPTO_THREAD_run_once()
  103.   }
  104.   
  105. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
  106.   {
  107.       if (pthread_once(once, init) != 0)

crypto/threads_pthread.c:107:9: Taking false branch
  105.   int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
  106.   {
  107.       if (pthread_once(once, init) != 0)
                 ^
  108.           return 0;
  109.   

crypto/threads_pthread.c:110:5: 
  108.           return 0;
  109.   
  110. >     return 1;
  111.   }
  112.   

crypto/threads_pthread.c:111:1: return from a call to CRYPTO_THREAD_run_once
  109.   
  110.       return 1;
  111. > }
  112.   
  113.   int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))

crypto/err/err.c:685:10: Condition is true
683.       ERR_STATE *state = NULL;
684.   
685.       if (!RUN_ONCE(&err_init, err_do_init))
                ^
686.           return NULL;
687.   

crypto/err/err.c:685:10: Taking false branch
683.       ERR_STATE *state = NULL;
684.   
685.       if (!RUN_ONCE(&err_init, err_do_init))
                ^
686.           return NULL;
687.   

crypto/err/err.c:688:5: 
686.           return NULL;
687.   
688. >     state = CRYPTO_THREAD_get_local(&err_thread_local);
689.   
690.       if (state == NULL) {

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

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

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

crypto/err/err.c:690:9: Taking true branch
688.       state = CRYPTO_THREAD_get_local(&err_thread_local);
689.   
690.       if (state == NULL) {
               ^
691.           state = OPENSSL_zalloc(sizeof(*state));
692.           if (state == NULL)

crypto/err/err.c:691:9: 
689.   
690.       if (state == NULL) {
691. >         state = OPENSSL_zalloc(sizeof(*state));
692.           if (state == NULL)
693.               return NULL;

crypto/mem.c:197:1: start of procedure CRYPTO_zalloc()
  195.   }
  196.   
  197. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  198.   {
  199.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:199:5: 
  197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  198.   {
  199. >     void *ret = CRYPTO_malloc(num, file, line);
  200.   
  201.       FAILTEST();

crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
    167.   #endif
    168.   
    169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    170.   {
    171.       void *ret = NULL;

crypto/mem.c:171:5: 
    169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    170.   {
    171. >     void *ret = NULL;
    172.   
    173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking false branch
    171.       void *ret = NULL;
    172.   
    173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    174.           return malloc_impl(num, file, line);
    175.   

crypto/mem.c:176:9: Taking false branch
    174.           return malloc_impl(num, file, line);
    175.   
    176.       if (num == 0)
                   ^
    177.           return NULL;
    178.   

crypto/mem.c:180:5: 
    178.   
    179.       FAILTEST();
    180. >     allow_customize = 0;
    181.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    182.       if (call_malloc_debug) {

crypto/mem.c:190:5: 
    188.       }
    189.   #else
    190. >     osslargused(file); osslargused(line);
    191.       ret = malloc(num);
    192.   #endif

crypto/mem.c:190:24: 
    188.       }
    189.   #else
    190. >     osslargused(file); osslargused(line);
    191.       ret = malloc(num);
    192.   #endif

crypto/mem.c:191:5: 
    189.   #else
    190.       osslargused(file); osslargused(line);
    191. >     ret = malloc(num);
    192.   #endif
    193.   

crypto/mem.c:194:5: 
    192.   #endif
    193.   
    194. >     return ret;
    195.   }
    196.   

crypto/mem.c:195:1: return from a call to CRYPTO_malloc
    193.   
    194.       return ret;
    195. > }
    196.   
    197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:202:9: Taking true branch
  200.   
  201.       FAILTEST();
  202.       if (ret != NULL)
                 ^
  203.           memset(ret, 0, num);
  204.       return ret;

crypto/mem.c:203:9: 
  201.       FAILTEST();
  202.       if (ret != NULL)
  203. >         memset(ret, 0, num);
  204.       return ret;
  205.   }

crypto/mem.c:204:5: 
  202.       if (ret != NULL)
  203.           memset(ret, 0, num);
  204. >     return ret;
  205.   }
  206.   

crypto/mem.c:205:1: return from a call to CRYPTO_zalloc
  203.           memset(ret, 0, num);
  204.       return ret;
  205. > }
  206.   
  207.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/err/err.c:692:13: Taking false branch
690.       if (state == NULL) {
691.           state = OPENSSL_zalloc(sizeof(*state));
692.           if (state == NULL)
                   ^
693.               return NULL;
694.   

crypto/err/err.c:695:14: 
693.               return NULL;
694.   
695. >         if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE)
696.               || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
697.               ERR_STATE_free(state);

crypto/init.c:363:1: start of procedure ossl_init_thread_start()
  361.   }
  362.   
  363. > int ossl_init_thread_start(uint64_t opts)
  364.   {
  365.       struct thread_local_inits_st *locals;

crypto/init.c:367:10: Taking true branch
  365.       struct thread_local_inits_st *locals;
  366.   
  367.       if (!OPENSSL_init_crypto(0, NULL))
                  ^
  368.           return 0;
  369.   

crypto/init.c:368:9: 
  366.   
  367.       if (!OPENSSL_init_crypto(0, NULL))
  368. >         return 0;
  369.   
  370.       locals = ossl_init_get_thread_local(1);

crypto/init.c:392:1: return from a call to ossl_init_thread_start
  390.   
  391.       return 1;
  392. > }
  393.   
  394.   void OPENSSL_cleanup(void)

crypto/err/err.c:695:14: Taking true branch
693.               return NULL;
694.   
695.           if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE)
                    ^
696.               || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
697.               ERR_STATE_free(state);

crypto/err/err.c:697:13: Skipping ERR_STATE_free(): empty list of specs
695.           if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE)
696.               || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
697.               ERR_STATE_free(state);
                   ^
698.               return NULL;
699.           }
