crypto/init.c:384: error: MEMORY_LEAK
  memory dynamically allocated to `locals` by call to `ossl_init_get_thread_local()` at line 371, column 14 is not reachable after line 384, column 9.
Showing all 40 steps of the trace


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

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

crypto/init.c:371:5: 
369.           return 0;
370.   
371. >     locals = ossl_init_get_thread_local(1);
372.   
373.       if (locals == NULL)

crypto/init.c:41:1: start of procedure ossl_init_get_thread_local()
  39.   }
  40.   
  41. > static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc)
  42.   {
  43.       struct thread_local_inits_st *local =

crypto/init.c:43:5: 
  41.   static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc)
  42.   {
  43. >     struct thread_local_inits_st *local =
  44.           CRYPTO_THREAD_get_local(&threadstopkey);
  45.   

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/init.c:46:9: Taking true branch
  44.           CRYPTO_THREAD_get_local(&threadstopkey);
  45.   
  46.       if (local == NULL && alloc) {
                ^
  47.           local = OPENSSL_zalloc(sizeof *local);
  48.           if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {

crypto/init.c:46:26: Taking true branch
  44.           CRYPTO_THREAD_get_local(&threadstopkey);
  45.   
  46.       if (local == NULL && alloc) {
                                 ^
  47.           local = OPENSSL_zalloc(sizeof *local);
  48.           if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {

crypto/init.c:47:9: 
  45.   
  46.       if (local == NULL && alloc) {
  47. >         local = OPENSSL_zalloc(sizeof *local);
  48.           if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {
  49.               OPENSSL_free(local);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

crypto/init.c:48:13: Taking true branch
  46.       if (local == NULL && alloc) {
  47.           local = OPENSSL_zalloc(sizeof *local);
  48.           if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {
                    ^
  49.               OPENSSL_free(local);
  50.               return NULL;

crypto/init.c:48:31: 
  46.       if (local == NULL && alloc) {
  47.           local = OPENSSL_zalloc(sizeof *local);
  48. >         if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {
  49.               OPENSSL_free(local);
  50.               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/init.c:48:31: Taking false branch
  46.       if (local == NULL && alloc) {
  47.           local = OPENSSL_zalloc(sizeof *local);
  48.           if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {
                                      ^
  49.               OPENSSL_free(local);
  50.               return NULL;

crypto/init.c:53:10: Taking false branch
  51.           }
  52.       }
  53.       if (!alloc) {
                 ^
  54.           CRYPTO_THREAD_set_local(&threadstopkey, NULL);
  55.       }

crypto/init.c:57:5: 
  55.       }
  56.   
  57. >     return local;
  58.   }
  59.   

crypto/init.c:58:1: return from a call to ossl_init_get_thread_local
  56.   
  57.       return local;
  58. > }
  59.   
  60.   typedef struct ossl_init_stop_st OPENSSL_INIT_STOP;

crypto/init.c:373:9: Taking false branch
371.       locals = ossl_init_get_thread_local(1);
372.   
373.       if (locals == NULL)
               ^
374.           return 0;
375.   

crypto/init.c:376:9: Taking false branch
374.           return 0;
375.   
376.       if (opts & OPENSSL_INIT_THREAD_ASYNC) {
               ^
377.   #ifdef OPENSSL_INIT_DEBUG
378.           fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "

crypto/init.c:384:9: Taking false branch
382.       }
383.   
384.       if (opts & OPENSSL_INIT_THREAD_ERR_STATE) {
               ^
385.   #ifdef OPENSSL_INIT_DEBUG
386.           fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
