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


crypto/err/err.c:663:1: start of procedure ERR_get_state()
661.   }
662.   
663. > ERR_STATE *ERR_get_state(void)
664.   {
665.       ERR_STATE *state = NULL;

crypto/err/err.c:665:5: 
663.   ERR_STATE *ERR_get_state(void)
664.   {
665. >     ERR_STATE *state = NULL;
666.   
667.       if (!RUN_ONCE(&err_init, err_do_init))

crypto/err/err.c:667:10: 
665.       ERR_STATE *state = NULL;
666.   
667. >     if (!RUN_ONCE(&err_init, err_do_init))
668.           return NULL;
669.   

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:667:10: Condition is true
665.       ERR_STATE *state = NULL;
666.   
667.       if (!RUN_ONCE(&err_init, err_do_init))
                ^
668.           return NULL;
669.   

crypto/err/err.c:667:10: Taking false branch
665.       ERR_STATE *state = NULL;
666.   
667.       if (!RUN_ONCE(&err_init, err_do_init))
                ^
668.           return NULL;
669.   

crypto/err/err.c:675:10: Taking false branch
673.        * Needed on any platform that doesn't define OPENSSL_USE_NODELETE.
674.        */
675.       if (!OPENSSL_init_crypto(0, NULL))
                ^
676.           return NULL;
677.   

crypto/err/err.c:678:5: 
676.           return NULL;
677.   
678. >     state = CRYPTO_THREAD_get_local(&err_thread_local);
679.   
680.       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:680:9: Taking true branch
678.       state = CRYPTO_THREAD_get_local(&err_thread_local);
679.   
680.       if (state == NULL) {
               ^
681.           state = OPENSSL_zalloc(sizeof(*state));
682.           if (state == NULL)

crypto/err/err.c:681:9: 
679.   
680.       if (state == NULL) {
681. >         state = OPENSSL_zalloc(sizeof(*state));
682.           if (state == NULL)
683.               return NULL;

crypto/mem.c:218:1: start of procedure CRYPTO_zalloc()
  216.   }
  217.   
  218. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  219.   {
  220.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:220:5: 
  218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  219.   {
  220. >     void *ret = CRYPTO_malloc(num, file, line);
  221.   
  222.       FAILTEST();

crypto/mem.c:189:1: start of procedure CRYPTO_malloc()
    187.   #endif
    188.   
    189. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    190.   {
    191.       void *ret = NULL;

crypto/mem.c:191:5: 
    189.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    190.   {
    191. >     void *ret = NULL;
    192.   
    193.       INCREMENT(malloc_count);

crypto/mem.c:194:9: Taking false branch
    192.   
    193.       INCREMENT(malloc_count);
    194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    195.           return malloc_impl(num, file, line);
    196.   

crypto/mem.c:197:9: Taking false branch
    195.           return malloc_impl(num, file, line);
    196.   
    197.       if (num == 0)
                   ^
    198.           return NULL;
    199.   

crypto/mem.c:201:5: 
    199.   
    200.       FAILTEST();
    201. >     allow_customize = 0;
    202.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    203.       if (call_malloc_debug) {

crypto/mem.c:211:5: 
    209.       }
    210.   #else
    211. >     (void)(file); (void)(line);
    212.       ret = malloc(num);
    213.   #endif

crypto/mem.c:211:19: 
    209.       }
    210.   #else
    211. >     (void)(file); (void)(line);
    212.       ret = malloc(num);
    213.   #endif

crypto/mem.c:212:5: 
    210.   #else
    211.       (void)(file); (void)(line);
    212. >     ret = malloc(num);
    213.   #endif
    214.   

crypto/mem.c:215:5: 
    213.   #endif
    214.   
    215. >     return ret;
    216.   }
    217.   

crypto/mem.c:216:1: return from a call to CRYPTO_malloc
    214.   
    215.       return ret;
    216. > }
    217.   
    218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:223:9: Taking true branch
  221.   
  222.       FAILTEST();
  223.       if (ret != NULL)
                 ^
  224.           memset(ret, 0, num);
  225.       return ret;

crypto/mem.c:224:9: 
  222.       FAILTEST();
  223.       if (ret != NULL)
  224. >         memset(ret, 0, num);
  225.       return ret;
  226.   }

crypto/mem.c:225:5: 
  223.       if (ret != NULL)
  224.           memset(ret, 0, num);
  225. >     return ret;
  226.   }
  227.   

crypto/mem.c:226:1: return from a call to CRYPTO_zalloc
  224.           memset(ret, 0, num);
  225.       return ret;
  226. > }
  227.   
  228.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/err/err.c:682:13: Taking false branch
680.       if (state == NULL) {
681.           state = OPENSSL_zalloc(sizeof(*state));
682.           if (state == NULL)
                   ^
683.               return NULL;
684.   

crypto/err/err.c:685:14: 
683.               return NULL;
684.   
685. >         if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE)
686.               || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
687.               ERR_STATE_free(state);

crypto/init.c:377:1: start of procedure ossl_init_thread_start()
  375.   }
  376.   
  377. > int ossl_init_thread_start(uint64_t opts)
  378.   {
  379.       struct thread_local_inits_st *locals;

crypto/init.c:381:10: Taking true branch
  379.       struct thread_local_inits_st *locals;
  380.   
  381.       if (!OPENSSL_init_crypto(0, NULL))
                  ^
  382.           return 0;
  383.   

crypto/init.c:382:9: 
  380.   
  381.       if (!OPENSSL_init_crypto(0, NULL))
  382. >         return 0;
  383.   
  384.       locals = ossl_init_get_thread_local(1);

crypto/init.c:406:1: return from a call to ossl_init_thread_start
  404.   
  405.       return 1;
  406. > }
  407.   
  408.   void OPENSSL_cleanup(void)

crypto/err/err.c:685:14: Taking true branch
683.               return NULL;
684.   
685.           if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE)
                    ^
686.               || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
687.               ERR_STATE_free(state);

crypto/err/err.c:687:13: Skipping ERR_STATE_free(): empty list of specs
685.           if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE)
686.               || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
687.               ERR_STATE_free(state);
                   ^
688.               return NULL;
689.           }
