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:221:1: start of procedure CRYPTO_zalloc()
    219.   }
    220.   
    221. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    222.   {
    223.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:223:5: 
    221.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    222.   {
    223. >     void *ret = CRYPTO_malloc(num, file, line);
    224.   
    225.       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:5: 
      202.   
      203.       FAILTEST();
      204. >     allow_customize = 0;
      205.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      206.       if (call_malloc_debug) {

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

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

crypto/mem.c:215:5: 
      213.   #else
      214.       (void)(file); (void)(line);
      215. >     ret = malloc(num);
      216.   #endif
      217.   

crypto/mem.c:218:5: 
      216.   #endif
      217.   
      218. >     return ret;
      219.   }
      220.   

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

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

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

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

crypto/mem.c:229:1: return from a call to CRYPTO_zalloc
    227.           memset(ret, 0, num);
    228.       return ret;
    229. > }
    230.   
    231.   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: "
