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


ssl/ssl_lib.c:610:1: start of procedure SSL_new()
608.   }
609.   
610. > SSL *SSL_new(SSL_CTX *ctx)
611.   {
612.       SSL *s;

ssl/ssl_lib.c:614:9: Taking false branch
612.       SSL *s;
613.   
614.       if (ctx == NULL) {
               ^
615.           SSLerr(SSL_F_SSL_NEW, SSL_R_NULL_SSL_CTX);
616.           return NULL;

ssl/ssl_lib.c:618:9: Taking false branch
616.           return NULL;
617.       }
618.       if (ctx->method == NULL) {
               ^
619.           SSLerr(SSL_F_SSL_NEW, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
620.           return NULL;

ssl/ssl_lib.c:623:5: 
621.       }
622.   
623. >     s = OPENSSL_zalloc(sizeof(*s));
624.       if (s == NULL)
625.           goto err;

crypto/mem.c:218:1: start of procedure CRYPTO_zalloc()
  216.   }
  217.   
  218. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  219.   {
  220.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:220:5: 
  218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  219.   {
  220. >     void *ret = CRYPTO_malloc(num, file, line);
  221.   
  222.       FAILTEST();

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

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

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

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

crypto/mem.c:201:5: 
    199.   
    200.       FAILTEST();
    201. >     allow_customize = 0;
    202.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    203.       if (call_malloc_debug) {

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

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

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

crypto/mem.c:215:5: 
    213.   #endif
    214.   
    215. >     return ret;
    216.   }
    217.   

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

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

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

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

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

ssl/ssl_lib.c:624:9: Taking false branch
622.   
623.       s = OPENSSL_zalloc(sizeof(*s));
624.       if (s == NULL)
               ^
625.           goto err;
626.   

ssl/ssl_lib.c:627:5: 
625.           goto err;
626.   
627. >     s->references = 1;
628.       s->lock = CRYPTO_THREAD_lock_new();
629.       if (s->lock == NULL) {

ssl/ssl_lib.c:628:5: 
626.   
627.       s->references = 1;
628. >     s->lock = CRYPTO_THREAD_lock_new();
629.       if (s->lock == NULL) {
630.           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:218:1: start of procedure CRYPTO_zalloc()
    216.   }
    217.   
    218. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    219.   {
    220.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:220:5: 
    218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    219.   {
    220. >     void *ret = CRYPTO_malloc(num, file, line);
    221.   
    222.       FAILTEST();

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

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

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

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

crypto/mem.c:201:5: 
      199.   
      200.       FAILTEST();
      201. >     allow_customize = 0;
      202.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      203.       if (call_malloc_debug) {

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

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

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

crypto/mem.c:215:5: 
      213.   #endif
      214.   
      215. >     return ret;
      216.   }
      217.   

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

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

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

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

crypto/mem.c:226:1: return from a call to CRYPTO_zalloc
    224.           memset(ret, 0, num);
    225.       return ret;
    226. > }
    227.   
    228.   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:629:9: Taking false branch
627.       s->references = 1;
628.       s->lock = CRYPTO_THREAD_lock_new();
629.       if (s->lock == NULL) {
               ^
630.           OPENSSL_free(s);
631.           s = NULL;

ssl/ssl_lib.c:639:9: 
637.        * chained DRBG.
638.        */
639. >     if (RAND_get_rand_method() == RAND_OpenSSL()) {
640.           s->drbg =
641.               RAND_DRBG_new(RAND_DRBG_NID, RAND_DRBG_FLAG_CTR_USE_DF,

crypto/rand/rand_lib.c:556:1: start of procedure RAND_get_rand_method()
  554.   }
  555.   
  556. > const RAND_METHOD *RAND_get_rand_method(void)
  557.   {
  558.       const RAND_METHOD *tmp_meth = NULL;

crypto/rand/rand_lib.c:558:5: 
  556.   const RAND_METHOD *RAND_get_rand_method(void)
  557.   {
  558. >     const RAND_METHOD *tmp_meth = NULL;
  559.   
  560.       if (!RUN_ONCE(&rand_init, do_rand_init))

crypto/rand/rand_lib.c:560:10: 
  558.       const RAND_METHOD *tmp_meth = NULL;
  559.   
  560. >     if (!RUN_ONCE(&rand_init, do_rand_init))
  561.           return NULL;
  562.   

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:560:10: Condition is false
  558.       const RAND_METHOD *tmp_meth = NULL;
  559.   
  560.       if (!RUN_ONCE(&rand_init, do_rand_init))
                  ^
  561.           return NULL;
  562.   

crypto/rand/rand_lib.c:560:10: Taking true branch
  558.       const RAND_METHOD *tmp_meth = NULL;
  559.   
  560.       if (!RUN_ONCE(&rand_init, do_rand_init))
                  ^
  561.           return NULL;
  562.   

crypto/rand/rand_lib.c:561:9: 
  559.   
  560.       if (!RUN_ONCE(&rand_init, do_rand_init))
  561. >         return NULL;
  562.   
  563.       CRYPTO_THREAD_write_lock(rand_meth_lock);

crypto/rand/rand_lib.c:584:1: return from a call to RAND_get_rand_method
  582.       CRYPTO_THREAD_unlock(rand_meth_lock);
  583.       return tmp_meth;
  584. > }
  585.   
  586.   #ifndef OPENSSL_NO_ENGINE

crypto/rand/drbg_lib.c:683:1: start of procedure RAND_OpenSSL()
  681.   };
  682.   
  683. > RAND_METHOD *RAND_OpenSSL(void)
  684.   {
  685.       return &rand_meth;

crypto/rand/drbg_lib.c:685:5: 
  683.   RAND_METHOD *RAND_OpenSSL(void)
  684.   {
  685. >     return &rand_meth;
  686.   }

crypto/rand/drbg_lib.c:686:1: return from a call to RAND_OpenSSL
  684.   {
  685.       return &rand_meth;
  686. > }

ssl/ssl_lib.c:639:9: Taking false branch
637.        * chained DRBG.
638.        */
639.       if (RAND_get_rand_method() == RAND_OpenSSL()) {
               ^
640.           s->drbg =
641.               RAND_DRBG_new(RAND_DRBG_NID, RAND_DRBG_FLAG_CTR_USE_DF,

ssl/ssl_lib.c:650:5: Skipping RECORD_LAYER_init(): empty list of specs
648.       }
649.   
650.       RECORD_LAYER_init(&s->rlayer, s);
           ^
651.   
652.       s->options = ctx->options;
