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


ssl/ssl_lib.c:679:1: start of procedure SSL_new()
677.   }
678.   
679. > SSL *SSL_new(SSL_CTX *ctx)
680.   {
681.       SSL *s;

ssl/ssl_lib.c:683:9: Taking false branch
681.       SSL *s;
682.   
683.       if (ctx == NULL) {
               ^
684.           SSLerr(SSL_F_SSL_NEW, SSL_R_NULL_SSL_CTX);
685.           return NULL;

ssl/ssl_lib.c:687:9: Taking false branch
685.           return NULL;
686.       }
687.       if (ctx->method == NULL) {
               ^
688.           SSLerr(SSL_F_SSL_NEW, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
689.           return NULL;

ssl/ssl_lib.c:692:5: 
690.       }
691.   
692. >     s = OPENSSL_zalloc(sizeof(*s));
693.       if (s == NULL)
694.           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.   #if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE)

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:693:9: Taking false branch
691.   
692.       s = OPENSSL_zalloc(sizeof(*s));
693.       if (s == NULL)
               ^
694.           goto err;
695.   

ssl/ssl_lib.c:696:5: 
694.           goto err;
695.   
696. >     s->references = 1;
697.       s->lock = CRYPTO_THREAD_lock_new();
698.       if (s->lock == NULL) {

ssl/ssl_lib.c:697:5: 
695.   
696.       s->references = 1;
697. >     s->lock = CRYPTO_THREAD_lock_new();
698.       if (s->lock == NULL) {
699.           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:698:9: Taking false branch
696.       s->references = 1;
697.       s->lock = CRYPTO_THREAD_lock_new();
698.       if (s->lock == NULL) {
               ^
699.           OPENSSL_free(s);
700.           s = NULL;

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