ssl/ssl_lib.c:639: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_THREAD_lock_new()` at line 622, column 15 is not reachable after line 639, column 5.
Showing all 62 steps of the trace


ssl/ssl_lib.c:605:1: start of procedure SSL_new()
603.   }
604.   
605. > SSL *SSL_new(SSL_CTX *ctx)
606.   {
607.       SSL *s;

ssl/ssl_lib.c:609:9: Taking false branch
607.       SSL *s;
608.   
609.       if (ctx == NULL) {
               ^
610.           SSLerr(SSL_F_SSL_NEW, SSL_R_NULL_SSL_CTX);
611.           return (NULL);

ssl/ssl_lib.c:613:9: Taking false branch
611.           return (NULL);
612.       }
613.       if (ctx->method == NULL) {
               ^
614.           SSLerr(SSL_F_SSL_NEW, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
615.           return (NULL);

ssl/ssl_lib.c:618:5: 
616.       }
617.   
618. >     s = OPENSSL_zalloc(sizeof(*s));
619.       if (s == NULL)
620.           goto err;

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. >     (void)(file); (void)(line);
    191.       ret = malloc(num);
    192.   #endif

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

crypto/mem.c:191:5: 
    189.   #else
    190.       (void)(file); (void)(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)

ssl/ssl_lib.c:619:9: Taking false branch
617.   
618.       s = OPENSSL_zalloc(sizeof(*s));
619.       if (s == NULL)
               ^
620.           goto err;
621.   

ssl/ssl_lib.c:622:5: 
620.           goto err;
621.   
622. >     s->lock = CRYPTO_THREAD_lock_new();
623.       if (s->lock == NULL)
624.           goto err;

crypto/threads_pthread.c:19:1: start of procedure CRYPTO_THREAD_lock_new()
  17.   # endif
  18.   
  19. > CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
  20.   {
  21.   # ifdef USE_RWLOCK

crypto/threads_pthread.c:22:5: 
  20.   {
  21.   # ifdef USE_RWLOCK
  22. >     CRYPTO_RWLOCK *lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t));
  23.       if (lock == NULL)
  24.           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. >     (void)(file); (void)(line);
      191.       ret = malloc(num);
      192.   #endif

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

crypto/mem.c:191:5: 
      189.   #else
      190.       (void)(file); (void)(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/threads_pthread.c:23:9: Taking false branch
  21.   # ifdef USE_RWLOCK
  22.       CRYPTO_RWLOCK *lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t));
  23.       if (lock == NULL)
                ^
  24.           return NULL;
  25.   

crypto/threads_pthread.c:26:9: Taking false branch
  24.           return NULL;
  25.   
  26.       if (pthread_rwlock_init(lock, NULL) != 0) {
                ^
  27.           OPENSSL_free(lock);
  28.           return NULL;

crypto/threads_pthread.c:48:5: 
  46.   # endif
  47.   
  48. >     return lock;
  49.   }
  50.   

crypto/threads_pthread.c:49:1: return from a call to CRYPTO_THREAD_lock_new
  47.   
  48.       return lock;
  49. > }
  50.   
  51.   int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)

ssl/ssl_lib.c:623:9: Taking false branch
621.   
622.       s->lock = CRYPTO_THREAD_lock_new();
623.       if (s->lock == NULL)
               ^
624.           goto err;
625.   

ssl/ssl_lib.c:630:9: 
628.        * chained DRBG.
629.        */
630. >     if (RAND_get_rand_method() == RAND_OpenSSL()) {
631.           s->drbg = RAND_DRBG_new(NID_aes_128_ctr, RAND_DRBG_FLAG_CTR_USE_DF,
632.                                   RAND_DRBG_get0_global());

crypto/rand/rand_lib.c:288:1: start of procedure RAND_get_rand_method()
  286.   }
  287.   
  288. > const RAND_METHOD *RAND_get_rand_method(void)
  289.   {
  290.       const RAND_METHOD *tmp_meth = NULL;

crypto/rand/rand_lib.c:290:5: 
  288.   const RAND_METHOD *RAND_get_rand_method(void)
  289.   {
  290. >     const RAND_METHOD *tmp_meth = NULL;
  291.   
  292.       if (!RUN_ONCE(&rand_init, do_rand_init))

crypto/rand/rand_lib.c:292:10: 
  290.       const RAND_METHOD *tmp_meth = NULL;
  291.   
  292. >     if (!RUN_ONCE(&rand_init, do_rand_init))
  293.           return NULL;
  294.   

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 true 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:108:9: 
    106.   {
    107.       if (pthread_once(once, init) != 0)
    108. >         return 0;
    109.   
    110.       return 1;

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/rand/rand_lib.c:292:10: Condition is false
  290.       const RAND_METHOD *tmp_meth = NULL;
  291.   
  292.       if (!RUN_ONCE(&rand_init, do_rand_init))
                  ^
  293.           return NULL;
  294.   

crypto/rand/rand_lib.c:292:10: Taking true branch
  290.       const RAND_METHOD *tmp_meth = NULL;
  291.   
  292.       if (!RUN_ONCE(&rand_init, do_rand_init))
                  ^
  293.           return NULL;
  294.   

crypto/rand/rand_lib.c:293:9: 
  291.   
  292.       if (!RUN_ONCE(&rand_init, do_rand_init))
  293. >         return NULL;
  294.   
  295.       CRYPTO_THREAD_write_lock(rand_meth_lock);

crypto/rand/rand_lib.c:316:1: return from a call to RAND_get_rand_method
  314.       CRYPTO_THREAD_unlock(rand_meth_lock);
  315.       return tmp_meth;
  316. > }
  317.   
  318.   #ifndef OPENSSL_NO_ENGINE

crypto/rand/drbg_lib.c:420:1: start of procedure RAND_OpenSSL()
  418.   };
  419.   
  420. > RAND_METHOD *RAND_OpenSSL(void)
  421.   {
  422.       return &rand_meth;

crypto/rand/drbg_lib.c:422:5: 
  420.   RAND_METHOD *RAND_OpenSSL(void)
  421.   {
  422. >     return &rand_meth;
  423.   }

crypto/rand/drbg_lib.c:423:1: return from a call to RAND_OpenSSL
  421.   {
  422.       return &rand_meth;
  423. > }

ssl/ssl_lib.c:630:9: Taking false branch
628.        * chained DRBG.
629.        */
630.       if (RAND_get_rand_method() == RAND_OpenSSL()) {
               ^
631.           s->drbg = RAND_DRBG_new(NID_aes_128_ctr, RAND_DRBG_FLAG_CTR_USE_DF,
632.                                   RAND_DRBG_get0_global());

ssl/ssl_lib.c:639:5: Skipping RECORD_LAYER_init(): empty list of specs
637.       }
638.   
639.       RECORD_LAYER_init(&s->rlayer, s);
           ^
640.   
641.       s->options = ctx->options;
