ssl/bio_ssl.c:494: error: MEMORY_LEAK
  memory dynamically allocated by call to `BIO_new()` at line 491, column 16 is not reachable after line 494, column 9.
Showing all 24 steps of the trace


ssl/bio_ssl.c:486:1: start of procedure BIO_new_ssl()
484.   }
485.   
486. > BIO *BIO_new_ssl(SSL_CTX *ctx, int client)
487.   {
488.       BIO *ret;

ssl/bio_ssl.c:491:9: 
489.       SSL *ssl;
490.   
491. >     if ((ret = BIO_new(BIO_f_ssl())) == NULL)
492.           return (NULL);
493.       if ((ssl = SSL_new(ctx)) == NULL) {

ssl/bio_ssl.c:48:1: start of procedure BIO_f_ssl()
  46.   };
  47.   
  48. > const BIO_METHOD *BIO_f_ssl(void)
  49.   {
  50.       return (&methods_sslp);

ssl/bio_ssl.c:50:5: 
  48.   const BIO_METHOD *BIO_f_ssl(void)
  49.   {
  50. >     return (&methods_sslp);
  51.   }
  52.   

ssl/bio_ssl.c:51:1: return from a call to BIO_f_ssl
  49.   {
  50.       return (&methods_sslp);
  51. > }
  52.   
  53.   static int ssl_new(BIO *bi)

crypto/bio/bio_lib.c:17:1: start of procedure BIO_new()
  15.   #include <openssl/stack.h>
  16.   
  17. > BIO *BIO_new(const BIO_METHOD *method)
  18.   {
  19.       BIO *ret = OPENSSL_malloc(sizeof(*ret));

crypto/bio/bio_lib.c:19:5: 
  17.   BIO *BIO_new(const BIO_METHOD *method)
  18.   {
  19. >     BIO *ret = OPENSSL_malloc(sizeof(*ret));
  20.   
  21.       if (ret == NULL) {

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
    69.   }
    70.   
    71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73.       void *ret = NULL;

crypto/mem.c:73:5: 
    71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73. >     void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
    73.       void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                  ^
    76.           return malloc_impl(num, file, line);
    77.   

crypto/mem.c:78:9: Taking false branch
    76.           return malloc_impl(num, file, line);
    77.   
    78.       if (num <= 0)
                  ^
    79.           return NULL;
    80.   

crypto/mem.c:81:5: 
    79.           return NULL;
    80.   
    81. >     allow_customize = 0;
    82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:91:24: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:92:5: 
    90.   #else
    91.       osslargused(file); osslargused(line);
    92. >     ret = malloc(num);
    93.   #endif
    94.   

crypto/mem.c:95:5: 
    93.   #endif
    94.   
    95. >     return ret;
    96.   }
    97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
    94.   
    95.       return ret;
    96. > }
    97.   
    98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/bio/bio_lib.c:21:9: Taking false branch
  19.       BIO *ret = OPENSSL_malloc(sizeof(*ret));
  20.   
  21.       if (ret == NULL) {
                ^
  22.           BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);
  23.           return (NULL);

crypto/bio/bio_lib.c:25:10: Taking false branch
  23.           return (NULL);
  24.       }
  25.       if (!BIO_set(ret, method)) {
                 ^
  26.           OPENSSL_free(ret);
  27.           ret = NULL;

crypto/bio/bio_lib.c:29:5: 
  27.           ret = NULL;
  28.       }
  29. >     return (ret);
  30.   }
  31.   

crypto/bio/bio_lib.c:30:1: return from a call to BIO_new
  28.       }
  29.       return (ret);
  30. > }
  31.   
  32.   int BIO_set(BIO *bio, const BIO_METHOD *method)

ssl/bio_ssl.c:491:9: Taking false branch
489.       SSL *ssl;
490.   
491.       if ((ret = BIO_new(BIO_f_ssl())) == NULL)
               ^
492.           return (NULL);
493.       if ((ssl = SSL_new(ctx)) == NULL) {

ssl/bio_ssl.c:493:9: Taking true branch
491.       if ((ret = BIO_new(BIO_f_ssl())) == NULL)
492.           return (NULL);
493.       if ((ssl = SSL_new(ctx)) == NULL) {
               ^
494.           BIO_free(ret);
495.           return (NULL);

ssl/bio_ssl.c:494:9: Skipping BIO_free(): empty list of specs
492.           return (NULL);
493.       if ((ssl = SSL_new(ctx)) == NULL) {
494.           BIO_free(ret);
               ^
495.           return (NULL);
496.       }
