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


ssl/bio_ssl.c:468:1: start of procedure BIO_new_ssl_connect()
466.   }
467.   
468. > BIO *BIO_new_ssl_connect(SSL_CTX *ctx)
469.   {
470.   #ifndef OPENSSL_NO_SOCK

ssl/bio_ssl.c:471:5: 
469.   {
470.   #ifndef OPENSSL_NO_SOCK
471. >     BIO *ret = NULL, *con = NULL, *ssl = NULL;
472.   
473.       if ((con = BIO_new(BIO_s_connect())) == NULL)

ssl/bio_ssl.c:473:9: 
471.       BIO *ret = NULL, *con = NULL, *ssl = NULL;
472.   
473. >     if ((con = BIO_new(BIO_s_connect())) == NULL)
474.           return (NULL);
475.       if ((ssl = BIO_new_ssl(ctx, 1)) == NULL)

crypto/bio/bss_conn.c:240:1: start of procedure BIO_s_connect()
  238.   }
  239.   
  240. > const BIO_METHOD *BIO_s_connect(void)
  241.   {
  242.       return (&methods_connectp);

crypto/bio/bss_conn.c:242:5: 
  240.   const BIO_METHOD *BIO_s_connect(void)
  241.   {
  242. >     return (&methods_connectp);
  243.   }
  244.   

crypto/bio/bss_conn.c:243:1: return from a call to BIO_s_connect
  241.   {
  242.       return (&methods_connectp);
  243. > }
  244.   
  245.   static int conn_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:473:9: Taking false branch
471.       BIO *ret = NULL, *con = NULL, *ssl = NULL;
472.   
473.       if ((con = BIO_new(BIO_s_connect())) == NULL)
               ^
474.           return (NULL);
475.       if ((ssl = BIO_new_ssl(ctx, 1)) == NULL)

ssl/bio_ssl.c:475:9: 
473.       if ((con = BIO_new(BIO_s_connect())) == NULL)
474.           return (NULL);
475. >     if ((ssl = BIO_new_ssl(ctx, 1)) == NULL)
476.           goto err;
477.       if ((ret = BIO_push(ssl, con)) == NULL)

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 true 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:75:32: Taking true 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:76:9: Skipping __function_pointer__(): unresolved function pointer
      74.   
      75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
      76.           return malloc_impl(num, file, line);
                    ^
      77.   
      78.       if (num <= 0)

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.       }

ssl/bio_ssl.c:495:9: 
  493.       if ((ssl = SSL_new(ctx)) == NULL) {
  494.           BIO_free(ret);
  495. >         return (NULL);
  496.       }
  497.       if (client)

ssl/bio_ssl.c:504:1: return from a call to BIO_new_ssl
  502.       BIO_set_ssl(ret, ssl, BIO_CLOSE);
  503.       return (ret);
  504. > }
  505.   
  506.   int BIO_ssl_copy_session_id(BIO *t, BIO *f)

ssl/bio_ssl.c:475:9: Taking true branch
473.       if ((con = BIO_new(BIO_s_connect())) == NULL)
474.           return (NULL);
475.       if ((ssl = BIO_new_ssl(ctx, 1)) == NULL)
               ^
476.           goto err;
477.       if ((ret = BIO_push(ssl, con)) == NULL)

ssl/bio_ssl.c:480:2: 
478.           goto err;
479.       return (ret);
480. >  err:
481.       BIO_free(con);
482.   #endif

ssl/bio_ssl.c:481:5: Skipping BIO_free(): empty list of specs
479.       return (ret);
480.    err:
481.       BIO_free(con);
           ^
482.   #endif
483.       return (NULL);
