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


ssl/ssl_lib.c:666:1: start of procedure SSL_new()
664.   }
665.   
666. > SSL *SSL_new(SSL_CTX *ctx)
667.   {
668.       SSL *s;

ssl/ssl_lib.c:670:9: Taking false branch
668.       SSL *s;
669.   
670.       if (ctx == NULL) {
               ^
671.           SSLerr(SSL_F_SSL_NEW, SSL_R_NULL_SSL_CTX);
672.           return NULL;

ssl/ssl_lib.c:674:9: Taking false branch
672.           return NULL;
673.       }
674.       if (ctx->method == NULL) {
               ^
675.           SSLerr(SSL_F_SSL_NEW, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
676.           return NULL;

ssl/ssl_lib.c:679:5: 
677.       }
678.   
679. >     s = OPENSSL_zalloc(sizeof(*s));
680.       if (s == NULL)
681.           goto err;

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)

ssl/ssl_lib.c:680:9: Taking false branch
678.   
679.       s = OPENSSL_zalloc(sizeof(*s));
680.       if (s == NULL)
               ^
681.           goto err;
682.   

ssl/ssl_lib.c:683:5: 
681.           goto err;
682.   
683. >     s->references = 1;
684.       s->lock = CRYPTO_THREAD_lock_new();
685.       if (s->lock == NULL) {

ssl/ssl_lib.c:684:5: 
682.   
683.       s->references = 1;
684. >     s->lock = CRYPTO_THREAD_lock_new();
685.       if (s->lock == NULL) {
686.           OPENSSL_free(s);

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: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/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:685:9: Taking false branch
683.       s->references = 1;
684.       s->lock = CRYPTO_THREAD_lock_new();
685.       if (s->lock == NULL) {
               ^
686.           OPENSSL_free(s);
687.           s = NULL;

ssl/ssl_lib.c:695:9: 
693.        * chained DRBG.
694.        */
695. >     if (RAND_get_rand_method() == RAND_OpenSSL()) {
696.           s->drbg =
697.               RAND_DRBG_new(RAND_DRBG_NID, 0, RAND_DRBG_get0_public());

crypto/rand/rand_lib.c:709:1: start of procedure RAND_get_rand_method()
  707.   }
  708.   
  709. > const RAND_METHOD *RAND_get_rand_method(void)
  710.   {
  711.       const RAND_METHOD *tmp_meth = NULL;

crypto/rand/rand_lib.c:711:5: 
  709.   const RAND_METHOD *RAND_get_rand_method(void)
  710.   {
  711. >     const RAND_METHOD *tmp_meth = NULL;
  712.   
  713.       if (!RUN_ONCE(&rand_init, do_rand_init))

crypto/rand/rand_lib.c:713:10: 
  711.       const RAND_METHOD *tmp_meth = NULL;
  712.   
  713. >     if (!RUN_ONCE(&rand_init, do_rand_init))
  714.           return NULL;
  715.   

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:713:10: Condition is false
  711.       const RAND_METHOD *tmp_meth = NULL;
  712.   
  713.       if (!RUN_ONCE(&rand_init, do_rand_init))
                  ^
  714.           return NULL;
  715.   

crypto/rand/rand_lib.c:713:10: Taking true branch
  711.       const RAND_METHOD *tmp_meth = NULL;
  712.   
  713.       if (!RUN_ONCE(&rand_init, do_rand_init))
                  ^
  714.           return NULL;
  715.   

crypto/rand/rand_lib.c:714:9: 
  712.   
  713.       if (!RUN_ONCE(&rand_init, do_rand_init))
  714. >         return NULL;
  715.   
  716.       CRYPTO_THREAD_write_lock(rand_meth_lock);

crypto/rand/rand_lib.c:737:1: return from a call to RAND_get_rand_method
  735.       CRYPTO_THREAD_unlock(rand_meth_lock);
  736.       return tmp_meth;
  737. > }
  738.   
  739.   #ifndef OPENSSL_NO_ENGINE

crypto/rand/drbg_lib.c:977:1: start of procedure RAND_OpenSSL()
  975.   };
  976.   
  977. > RAND_METHOD *RAND_OpenSSL(void)
  978.   {
  979.       return &rand_meth;

crypto/rand/drbg_lib.c:979:5: 
  977.   RAND_METHOD *RAND_OpenSSL(void)
  978.   {
  979. >     return &rand_meth;
  980.   }

crypto/rand/drbg_lib.c:980:1: return from a call to RAND_OpenSSL
  978.   {
  979.       return &rand_meth;
  980. > }

ssl/ssl_lib.c:695:9: Taking false branch
693.        * chained DRBG.
694.        */
695.       if (RAND_get_rand_method() == RAND_OpenSSL()) {
               ^
696.           s->drbg =
697.               RAND_DRBG_new(RAND_DRBG_NID, 0, RAND_DRBG_get0_public());

ssl/ssl_lib.c:705:5: Skipping RECORD_LAYER_init(): empty list of specs
703.       }
704.   
705.       RECORD_LAYER_init(&s->rlayer, s);
           ^
706.   
707.       s->options = ctx->options;
