crypto/err/err.c:481: error: MEMORY_LEAK
  memory dynamically allocated by call to `ERR_get_state()` at line 475, column 10 is not reachable after line 481, column 14.
Showing all 52 steps of the trace


crypto/err/err.c:467:1: start of procedure get_error_values()
465.   }
466.   
467. > static unsigned long get_error_values(int inc, int top, const char **file,
468.                                         int *line, const char **data,
469.                                         int *flags)

crypto/err/err.c:471:5: 
469.                                         int *flags)
470.   {
471. >     int i = 0;
472.       ERR_STATE *es;
473.       unsigned long ret;

crypto/err/err.c:475:5: 
473.       unsigned long ret;
474.   
475. >     es = ERR_get_state();
476.       if (es == NULL)
477.           return 0;

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:228:1: start of procedure CRYPTO_zalloc()
    226.   }
    227.   
    228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:230:5: 
    228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230. >     void *ret = CRYPTO_malloc(num, file, line);
    231.   
    232.       FAILTEST();

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

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

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

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

crypto/mem.c:204:9: Taking true branch
      202.   
      203.       FAILTEST();
      204.       if (allow_customize) {
                     ^
      205.           /*
      206.            * Disallow customization after the first allocation. We only set this

crypto/mem.c:210:9: 
      208.            * allocation.
      209.            */
      210. >         allow_customize = 0;
      211.       }
      212.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:221:5: 
      219.       }
      220.   #else
      221. >     (void)(file); (void)(line);
      222.       ret = malloc(num);
      223.   #endif

crypto/mem.c:221:19: 
      219.       }
      220.   #else
      221. >     (void)(file); (void)(line);
      222.       ret = malloc(num);
      223.   #endif

crypto/mem.c:222:5: 
      220.   #else
      221.       (void)(file); (void)(line);
      222. >     ret = malloc(num);
      223.   #endif
      224.   

crypto/mem.c:225:5: 
      223.   #endif
      224.   
      225. >     return ret;
      226.   }
      227.   

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

crypto/mem.c:233:9: Taking true branch
    231.   
    232.       FAILTEST();
    233.       if (ret != NULL)
                   ^
    234.           memset(ret, 0, num);
    235.       return ret;

crypto/mem.c:234:9: 
    232.       FAILTEST();
    233.       if (ret != NULL)
    234. >         memset(ret, 0, num);
    235.       return ret;
    236.   }

crypto/mem.c:235:5: 
    233.       if (ret != NULL)
    234.           memset(ret, 0, num);
    235. >     return ret;
    236.   }
    237.   

crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
    234.           memset(ret, 0, num);
    235.       return ret;
    236. > }
    237.   
    238.   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: Taking false 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:686:17: 
  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);
  688.               return NULL;

crypto/threads_pthread.c:126:1: start of procedure CRYPTO_THREAD_set_local()
    124.   }
    125.   
    126. > int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
    127.   {
    128.       if (pthread_setspecific(*key, val) != 0)

crypto/threads_pthread.c:128:9: Taking false branch
    126.   int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
    127.   {
    128.       if (pthread_setspecific(*key, val) != 0)
                   ^
    129.           return 0;
    130.   

crypto/threads_pthread.c:131:5: 
    129.           return 0;
    130.   
    131. >     return 1;
    132.   }
    133.   

crypto/threads_pthread.c:132:1: return from a call to CRYPTO_THREAD_set_local
    130.   
    131.       return 1;
    132. > }
    133.   
    134.   int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key)

crypto/err/err.c:686:17: Taking false branch
  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);
  688.               return NULL;

crypto/err/err.c:692:9: Skipping OPENSSL_init_crypto(): empty list of specs
  690.   
  691.           /* Ignore failures from these */
  692.           OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
                 ^
  693.       }
  694.   

crypto/err/err.c:695:5: 
  693.       }
  694.   
  695. >     return state;
  696.   }
  697.   

crypto/err/err.c:696:1: return from a call to ERR_get_state
  694.   
  695.       return state;
  696. > }
  697.   
  698.   int ERR_get_next_error_library(void)

crypto/err/err.c:476:9: Taking false branch
474.   
475.       es = ERR_get_state();
476.       if (es == NULL)
               ^
477.           return 0;
478.   

crypto/err/err.c:479:9: Taking true branch
477.           return 0;
478.   
479.       if (inc && top) {
               ^
480.           if (file)
481.               *file = "";

crypto/err/err.c:479:16: Taking true branch
477.           return 0;
478.   
479.       if (inc && top) {
                      ^
480.           if (file)
481.               *file = "";

crypto/err/err.c:480:13: Taking true branch
478.   
479.       if (inc && top) {
480.           if (file)
                   ^
481.               *file = "";
482.           if (line)

crypto/err/err.c:481:13: 
479.       if (inc && top) {
480.           if (file)
481. >             *file = "";
482.           if (line)
483.               *line = 0;
