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


ssl/ssl_lib.c:519:1: start of procedure SSL_new()
517.   }
518.   
519. > SSL *SSL_new(SSL_CTX *ctx)
520.   {
521.       SSL *s;

ssl/ssl_lib.c:523:9: Taking false branch
521.       SSL *s;
522.   
523.       if (ctx == NULL) {
               ^
524.           SSLerr(SSL_F_SSL_NEW, SSL_R_NULL_SSL_CTX);
525.           return (NULL);

ssl/ssl_lib.c:527:9: Taking false branch
525.           return (NULL);
526.       }
527.       if (ctx->method == NULL) {
               ^
528.           SSLerr(SSL_F_SSL_NEW, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
529.           return (NULL);

ssl/ssl_lib.c:532:5: 
530.       }
531.   
532. >     s = OPENSSL_zalloc(sizeof(*s));
533.       if (s == NULL)
534.           goto err;

crypto/mem.c:185:1: start of procedure CRYPTO_zalloc()
  183.   }
  184.   
  185. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  186.   {
  187.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:187:5: 
  185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  186.   {
  187. >     void *ret = CRYPTO_malloc(num, file, line);
  188.   
  189.       FAILTEST();

crypto/mem.c:157:1: start of procedure CRYPTO_malloc()
    155.   #endif
    156.   
    157. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    158.   {
    159.       void *ret = NULL;

crypto/mem.c:159:5: 
    157.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    158.   {
    159. >     void *ret = NULL;
    160.   
    161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:161:9: Taking false branch
    159.       void *ret = NULL;
    160.   
    161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    162.           return malloc_impl(num, file, line);
    163.   

crypto/mem.c:164:9: Taking false branch
    162.           return malloc_impl(num, file, line);
    163.   
    164.       if (num <= 0)
                   ^
    165.           return NULL;
    166.   

crypto/mem.c:168:5: 
    166.   
    167.       FAILTEST();
    168. >     allow_customize = 0;
    169.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    170.       if (call_malloc_debug) {

crypto/mem.c:178:5: 
    176.       }
    177.   #else
    178. >     osslargused(file); osslargused(line);
    179.       ret = malloc(num);
    180.   #endif

crypto/mem.c:178:24: 
    176.       }
    177.   #else
    178. >     osslargused(file); osslargused(line);
    179.       ret = malloc(num);
    180.   #endif

crypto/mem.c:179:5: 
    177.   #else
    178.       osslargused(file); osslargused(line);
    179. >     ret = malloc(num);
    180.   #endif
    181.   

crypto/mem.c:182:5: 
    180.   #endif
    181.   
    182. >     return ret;
    183.   }
    184.   

crypto/mem.c:183:1: return from a call to CRYPTO_malloc
    181.   
    182.       return ret;
    183. > }
    184.   
    185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:190:9: Taking true branch
  188.   
  189.       FAILTEST();
  190.       if (ret != NULL)
                 ^
  191.           memset(ret, 0, num);
  192.       return ret;

crypto/mem.c:191:9: 
  189.       FAILTEST();
  190.       if (ret != NULL)
  191. >         memset(ret, 0, num);
  192.       return ret;
  193.   }

crypto/mem.c:192:5: 
  190.       if (ret != NULL)
  191.           memset(ret, 0, num);
  192. >     return ret;
  193.   }
  194.   

crypto/mem.c:193:1: return from a call to CRYPTO_zalloc
  191.           memset(ret, 0, num);
  192.       return ret;
  193. > }
  194.   
  195.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

ssl/ssl_lib.c:533:9: Taking false branch
531.   
532.       s = OPENSSL_zalloc(sizeof(*s));
533.       if (s == NULL)
               ^
534.           goto err;
535.   

ssl/ssl_lib.c:536:5: 
534.           goto err;
535.   
536. >     s->lock = CRYPTO_THREAD_lock_new();
537.       if (s->lock == NULL) {
538.           SSLerr(SSL_F_SSL_NEW, ERR_R_MALLOC_FAILURE);

crypto/threads_pthread.c:14:1: start of procedure CRYPTO_THREAD_lock_new()
  12.   #if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && !defined(OPENSSL_SYS_WINDOWS)
  13.   
  14. > CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
  15.   {
  16.       CRYPTO_RWLOCK *lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t));

crypto/threads_pthread.c:16:5: 
  14.   CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
  15.   {
  16. >     CRYPTO_RWLOCK *lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t));
  17.       if (lock == NULL)
  18.           return NULL;

crypto/mem.c:185:1: start of procedure CRYPTO_zalloc()
    183.   }
    184.   
    185. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    186.   {
    187.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:187:5: 
    185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    186.   {
    187. >     void *ret = CRYPTO_malloc(num, file, line);
    188.   
    189.       FAILTEST();

crypto/mem.c:157:1: start of procedure CRYPTO_malloc()
      155.   #endif
      156.   
      157. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      158.   {
      159.       void *ret = NULL;

crypto/mem.c:159:5: 
      157.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      158.   {
      159. >     void *ret = NULL;
      160.   
      161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:161:9: Taking false branch
      159.       void *ret = NULL;
      160.   
      161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      162.           return malloc_impl(num, file, line);
      163.   

crypto/mem.c:164:9: Taking false branch
      162.           return malloc_impl(num, file, line);
      163.   
      164.       if (num <= 0)
                     ^
      165.           return NULL;
      166.   

crypto/mem.c:168:5: 
      166.   
      167.       FAILTEST();
      168. >     allow_customize = 0;
      169.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      170.       if (call_malloc_debug) {

crypto/mem.c:178:5: 
      176.       }
      177.   #else
      178. >     osslargused(file); osslargused(line);
      179.       ret = malloc(num);
      180.   #endif

crypto/mem.c:178:24: 
      176.       }
      177.   #else
      178. >     osslargused(file); osslargused(line);
      179.       ret = malloc(num);
      180.   #endif

crypto/mem.c:179:5: 
      177.   #else
      178.       osslargused(file); osslargused(line);
      179. >     ret = malloc(num);
      180.   #endif
      181.   

crypto/mem.c:182:5: 
      180.   #endif
      181.   
      182. >     return ret;
      183.   }
      184.   

crypto/mem.c:183:1: return from a call to CRYPTO_malloc
      181.   
      182.       return ret;
      183. > }
      184.   
      185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:190:9: Taking true branch
    188.   
    189.       FAILTEST();
    190.       if (ret != NULL)
                   ^
    191.           memset(ret, 0, num);
    192.       return ret;

crypto/mem.c:191:9: 
    189.       FAILTEST();
    190.       if (ret != NULL)
    191. >         memset(ret, 0, num);
    192.       return ret;
    193.   }

crypto/mem.c:192:5: 
    190.       if (ret != NULL)
    191.           memset(ret, 0, num);
    192. >     return ret;
    193.   }
    194.   

crypto/mem.c:193:1: return from a call to CRYPTO_zalloc
    191.           memset(ret, 0, num);
    192.       return ret;
    193. > }
    194.   
    195.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/threads_pthread.c:17:9: Taking false branch
  15.   {
  16.       CRYPTO_RWLOCK *lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t));
  17.       if (lock == NULL)
                ^
  18.           return NULL;
  19.   

crypto/threads_pthread.c:20:9: Taking false branch
  18.           return NULL;
  19.   
  20.       if (pthread_rwlock_init(lock, NULL) != 0) {
                ^
  21.           OPENSSL_free(lock);
  22.           return NULL;

crypto/threads_pthread.c:25:5: 
  23.       }
  24.   
  25. >     return lock;
  26.   }
  27.   

crypto/threads_pthread.c:26:1: return from a call to CRYPTO_THREAD_lock_new
  24.   
  25.       return lock;
  26. > }
  27.   
  28.   int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)

ssl/ssl_lib.c:537:9: Taking false branch
535.   
536.       s->lock = CRYPTO_THREAD_lock_new();
537.       if (s->lock == NULL) {
               ^
538.           SSLerr(SSL_F_SSL_NEW, ERR_R_MALLOC_FAILURE);
539.           OPENSSL_free(s);

ssl/ssl_lib.c:543:5: Skipping RECORD_LAYER_init(): empty list of specs
541.       }
542.   
543.       RECORD_LAYER_init(&s->rlayer, s);
           ^
544.   
545.       s->options = ctx->options;
