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


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

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

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

ssl/ssl_lib.c:682:5: 
680.       }
681.   
682. >     s = OPENSSL_zalloc(sizeof(*s));
683.       if (s == NULL)
684.           goto err;

crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
  226.   }
  227.   
  228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  229.   {
  230.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:230:5: 
  228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  229.   {
  230. >     void *ret = CRYPTO_malloc(num, file, line);
  231.   
  232.       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:9: Taking true branch
    202.   
    203.       FAILTEST();
    204.       if (allow_customize) {
                   ^
    205.           /*
    206.            * Disallow customization after the first allocation. We only set this

crypto/mem.c:210:9: 
    208.            * allocation.
    209.            */
    210. >         allow_customize = 0;
    211.       }
    212.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:221:5: 
    219.       }
    220.   #else
    221. >     (void)(file); (void)(line);
    222.       ret = malloc(num);
    223.   #endif

crypto/mem.c:221:19: 
    219.       }
    220.   #else
    221. >     (void)(file); (void)(line);
    222.       ret = malloc(num);
    223.   #endif

crypto/mem.c:222:5: 
    220.   #else
    221.       (void)(file); (void)(line);
    222. >     ret = malloc(num);
    223.   #endif
    224.   

crypto/mem.c:225:5: 
    223.   #endif
    224.   
    225. >     return ret;
    226.   }
    227.   

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

crypto/mem.c:233:9: Taking true branch
  231.   
  232.       FAILTEST();
  233.       if (ret != NULL)
                 ^
  234.           memset(ret, 0, num);
  235.       return ret;

crypto/mem.c:234:9: 
  232.       FAILTEST();
  233.       if (ret != NULL)
  234. >         memset(ret, 0, num);
  235.       return ret;
  236.   }

crypto/mem.c:235:5: 
  233.       if (ret != NULL)
  234.           memset(ret, 0, num);
  235. >     return ret;
  236.   }
  237.   

crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
  234.           memset(ret, 0, num);
  235.       return ret;
  236. > }
  237.   
  238.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

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

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

ssl/ssl_lib.c:687:5: 
685.   
686.       s->references = 1;
687. >     s->lock = CRYPTO_THREAD_lock_new();
688.       if (s->lock == NULL) {
689.           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:24:9: 
  22.       CRYPTO_RWLOCK *lock;
  23.   
  24. >     if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL) {
  25.           /* Don't set error, to avoid recursion blowup. */
  26.           return NULL;

crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
    226.   }
    227.   
    228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:230:5: 
    228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230. >     void *ret = CRYPTO_malloc(num, file, line);
    231.   
    232.       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:9: Taking false branch
      202.   
      203.       FAILTEST();
      204.       if (allow_customize) {
                     ^
      205.           /*
      206.            * Disallow customization after the first allocation. We only set this

crypto/mem.c:221:5: 
      219.       }
      220.   #else
      221. >     (void)(file); (void)(line);
      222.       ret = malloc(num);
      223.   #endif

crypto/mem.c:221:19: 
      219.       }
      220.   #else
      221. >     (void)(file); (void)(line);
      222.       ret = malloc(num);
      223.   #endif

crypto/mem.c:222:5: 
      220.   #else
      221.       (void)(file); (void)(line);
      222. >     ret = malloc(num);
      223.   #endif
      224.   

crypto/mem.c:225:5: 
      223.   #endif
      224.   
      225. >     return ret;
      226.   }
      227.   

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

crypto/mem.c:233:9: Taking true branch
    231.   
    232.       FAILTEST();
    233.       if (ret != NULL)
                   ^
    234.           memset(ret, 0, num);
    235.       return ret;

crypto/mem.c:234:9: 
    232.       FAILTEST();
    233.       if (ret != NULL)
    234. >         memset(ret, 0, num);
    235.       return ret;
    236.   }

crypto/mem.c:235:5: 
    233.       if (ret != NULL)
    234.           memset(ret, 0, num);
    235. >     return ret;
    236.   }
    237.   

crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
    234.           memset(ret, 0, num);
    235.       return ret;
    236. > }
    237.   
    238.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/threads_pthread.c:24:9: Taking false branch
  22.       CRYPTO_RWLOCK *lock;
  23.   
  24.       if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL) {
                ^
  25.           /* Don't set error, to avoid recursion blowup. */
  26.           return NULL;

crypto/threads_pthread.c:29:9: Taking false branch
  27.       }
  28.   
  29.       if (pthread_rwlock_init(lock, NULL) != 0) {
                ^
  30.           OPENSSL_free(lock);
  31.           return NULL;

crypto/threads_pthread.c:54:5: 
  52.   # endif
  53.   
  54. >     return lock;
  55.   }
  56.   

crypto/threads_pthread.c:55:1: return from a call to CRYPTO_THREAD_lock_new
  53.   
  54.       return lock;
  55. > }
  56.   
  57.   int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)

ssl/ssl_lib.c:688:9: Taking false branch
686.       s->references = 1;
687.       s->lock = CRYPTO_THREAD_lock_new();
688.       if (s->lock == NULL) {
               ^
689.           OPENSSL_free(s);
690.           s = NULL;

ssl/ssl_lib.c:694:5: Skipping RECORD_LAYER_init(): empty list of specs
692.       }
693.   
694.       RECORD_LAYER_init(&s->rlayer, s);
           ^
695.   
696.       s->options = ctx->options;
