apps/s_server.c:2697: error: MEMORY_LEAK
  memory dynamically allocated to `ssl_bio` by call to `BIO_new()` at line 2696, column 15 is not reachable after line 2697, column 10.
Showing all 63 steps of the trace


apps/s_server.c:2676:1: start of procedure www_body()
2674.   #endif
2675.   
2676. > static int www_body(const char *hostname, int s, int stype,
2677.                       unsigned char *context)
2678.   {

apps/s_server.c:2679:5: 
2677.                       unsigned char *context)
2678.   {
2679. >     char *buf = NULL;
2680.       int ret = 1;
2681.       int i, j, k, dot;

apps/s_server.c:2680:5: 
2678.   {
2679.       char *buf = NULL;
2680. >     int ret = 1;
2681.       int i, j, k, dot;
2682.       SSL *con;

apps/s_server.c:2692:5: 
2690.   
2691.       /* Set width for a select call if needed */
2692. >     width = s + 1;
2693.   
2694.       buf = app_malloc(bufsize, "server www buffer");

apps/s_server.c:2694:5: 
2692.       width = s + 1;
2693.   
2694. >     buf = app_malloc(bufsize, "server www buffer");
2695.       io = BIO_new(BIO_f_buffer());
2696.       ssl_bio = BIO_new(BIO_f_ssl());

apps/apps.c:991:1: start of procedure app_malloc()
  989.   }
  990.   
  991. > void* app_malloc(int sz, const char *what)
  992.   {
  993.       void *vp = OPENSSL_malloc(sz);

apps/apps.c:993:5: 
  991.   void* app_malloc(int sz, const char *what)
  992.   {
  993. >     void *vp = OPENSSL_malloc(sz);
  994.   
  995.       if (vp == NULL) {

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
    117.   }
    118.   
    119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121.       void *ret = NULL;

crypto/mem.c:121:5: 
    119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121. >     void *ret = NULL;
    122.   
    123.       if (num <= 0)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (num <= 0)
                   ^
    124.           return NULL;
    125.   

crypto/mem.c:126:5: 
    124.           return NULL;
    125.   
    126. >     allow_customize = 0;
    127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
    134.       }
    135.   #else
    136. >     (void)file;
    137.       (void)line;
    138.       ret = malloc(num);

crypto/mem.c:137:5: 
    135.   #else
    136.       (void)file;
    137. >     (void)line;
    138.       ret = malloc(num);
    139.   #endif

crypto/mem.c:138:5: 
    136.       (void)file;
    137.       (void)line;
    138. >     ret = malloc(num);
    139.   #endif
    140.   

crypto/mem.c:153:5: 
    151.   #endif
    152.   
    153. >     return ret;
    154.   }
    155.   

crypto/mem.c:154:1: return from a call to CRYPTO_malloc
    152.   
    153.       return ret;
    154. > }
    155.   
    156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

apps/apps.c:995:9: Taking false branch
  993.       void *vp = OPENSSL_malloc(sz);
  994.   
  995.       if (vp == NULL) {
                 ^
  996.           BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n",
  997.                   opt_getprog(), sz, what);

apps/apps.c:1001:5: 
  999.           exit(1);
  1000.       }
  1001. >     return vp;
  1002.   }
  1003.   

apps/apps.c:1002:1: return from a call to app_malloc
  1000.       }
  1001.       return vp;
  1002. > }
  1003.   
  1004.   /*

apps/s_server.c:2695:5: 
2693.   
2694.       buf = app_malloc(bufsize, "server www buffer");
2695. >     io = BIO_new(BIO_f_buffer());
2696.       ssl_bio = BIO_new(BIO_f_ssl());
2697.       if ((io == NULL) || (ssl_bio == NULL))

crypto/bio/bf_buff.c:86:1: start of procedure BIO_f_buffer()
  84.   };
  85.   
  86. > BIO_METHOD *BIO_f_buffer(void)
  87.   {
  88.       return (&methods_buffer);

crypto/bio/bf_buff.c:88:5: 
  86.   BIO_METHOD *BIO_f_buffer(void)
  87.   {
  88. >     return (&methods_buffer);
  89.   }
  90.   

crypto/bio/bf_buff.c:89:1: return from a call to BIO_f_buffer
  87.   {
  88.       return (&methods_buffer);
  89. > }
  90.   
  91.   static int buffer_new(BIO *bi)

crypto/bio/bio_lib.c:65:1: start of procedure BIO_new()
  63.   #include <openssl/stack.h>
  64.   
  65. > BIO *BIO_new(BIO_METHOD *method)
  66.   {
  67.       BIO *ret = OPENSSL_malloc(sizeof(*ret));

crypto/bio/bio_lib.c:67:5: 
  65.   BIO *BIO_new(BIO_METHOD *method)
  66.   {
  67. >     BIO *ret = OPENSSL_malloc(sizeof(*ret));
  68.   
  69.       if (ret == NULL) {

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
    117.   }
    118.   
    119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121.       void *ret = NULL;

crypto/mem.c:121:5: 
    119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121. >     void *ret = NULL;
    122.   
    123.       if (num <= 0)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (num <= 0)
                   ^
    124.           return NULL;
    125.   

crypto/mem.c:126:5: 
    124.           return NULL;
    125.   
    126. >     allow_customize = 0;
    127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
    134.       }
    135.   #else
    136. >     (void)file;
    137.       (void)line;
    138.       ret = malloc(num);

crypto/mem.c:137:5: 
    135.   #else
    136.       (void)file;
    137. >     (void)line;
    138.       ret = malloc(num);
    139.   #endif

crypto/mem.c:138:5: 
    136.       (void)file;
    137.       (void)line;
    138. >     ret = malloc(num);
    139.   #endif
    140.   

crypto/mem.c:153:5: 
    151.   #endif
    152.   
    153. >     return ret;
    154.   }
    155.   

crypto/mem.c:154:1: return from a call to CRYPTO_malloc
    152.   
    153.       return ret;
    154. > }
    155.   
    156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/bio/bio_lib.c:69:9: Taking false branch
  67.       BIO *ret = OPENSSL_malloc(sizeof(*ret));
  68.   
  69.       if (ret == NULL) {
                ^
  70.           BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);
  71.           return (NULL);

crypto/bio/bio_lib.c:73:10: Taking true branch
  71.           return (NULL);
  72.       }
  73.       if (!BIO_set(ret, method)) {
                 ^
  74.           OPENSSL_free(ret);
  75.           ret = NULL;

crypto/bio/bio_lib.c:74:9: 
  72.       }
  73.       if (!BIO_set(ret, method)) {
  74. >         OPENSSL_free(ret);
  75.           ret = NULL;
  76.       }

crypto/mem.c:233:1: start of procedure CRYPTO_free()
    231.   }
    232.   
    233. > void CRYPTO_free(void *str)
    234.   {
    235.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:244:5: 
    242.       }
    243.   #else
    244. >     free(str);
    245.   #endif
    246.   }

crypto/mem.c:246:1: return from a call to CRYPTO_free
    244.       free(str);
    245.   #endif
    246. > }
    247.   
    248.   void CRYPTO_clear_free(void *str, size_t num)

crypto/bio/bio_lib.c:75:9: 
  73.       if (!BIO_set(ret, method)) {
  74.           OPENSSL_free(ret);
  75. >         ret = NULL;
  76.       }
  77.       return (ret);

crypto/bio/bio_lib.c:77:5: 
  75.           ret = NULL;
  76.       }
  77. >     return (ret);
  78.   }
  79.   

crypto/bio/bio_lib.c:78:1: return from a call to BIO_new
  76.       }
  77.       return (ret);
  78. > }
  79.   
  80.   int BIO_set(BIO *bio, BIO_METHOD *method)

apps/s_server.c:2696:5: 
2694.       buf = app_malloc(bufsize, "server www buffer");
2695.       io = BIO_new(BIO_f_buffer());
2696. >     ssl_bio = BIO_new(BIO_f_ssl());
2697.       if ((io == NULL) || (ssl_bio == NULL))
2698.           goto err;

ssl/bio_ssl.c:96:1: start of procedure BIO_f_ssl()
  94.   };
  95.   
  96. > BIO_METHOD *BIO_f_ssl(void)
  97.   {
  98.       return (&methods_sslp);

ssl/bio_ssl.c:98:5: 
  96.   BIO_METHOD *BIO_f_ssl(void)
  97.   {
  98. >     return (&methods_sslp);
  99.   }
  100.   

ssl/bio_ssl.c:99:1: return from a call to BIO_f_ssl
  97.   {
  98.       return (&methods_sslp);
  99. > }
  100.   
  101.   static int ssl_new(BIO *bi)

crypto/bio/bio_lib.c:65:1: start of procedure BIO_new()
  63.   #include <openssl/stack.h>
  64.   
  65. > BIO *BIO_new(BIO_METHOD *method)
  66.   {
  67.       BIO *ret = OPENSSL_malloc(sizeof(*ret));

crypto/bio/bio_lib.c:67:5: 
  65.   BIO *BIO_new(BIO_METHOD *method)
  66.   {
  67. >     BIO *ret = OPENSSL_malloc(sizeof(*ret));
  68.   
  69.       if (ret == NULL) {

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
    117.   }
    118.   
    119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121.       void *ret = NULL;

crypto/mem.c:121:5: 
    119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121. >     void *ret = NULL;
    122.   
    123.       if (num <= 0)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (num <= 0)
                   ^
    124.           return NULL;
    125.   

crypto/mem.c:126:5: 
    124.           return NULL;
    125.   
    126. >     allow_customize = 0;
    127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
    134.       }
    135.   #else
    136. >     (void)file;
    137.       (void)line;
    138.       ret = malloc(num);

crypto/mem.c:137:5: 
    135.   #else
    136.       (void)file;
    137. >     (void)line;
    138.       ret = malloc(num);
    139.   #endif

crypto/mem.c:138:5: 
    136.       (void)file;
    137.       (void)line;
    138. >     ret = malloc(num);
    139.   #endif
    140.   

crypto/mem.c:153:5: 
    151.   #endif
    152.   
    153. >     return ret;
    154.   }
    155.   

crypto/mem.c:154:1: return from a call to CRYPTO_malloc
    152.   
    153.       return ret;
    154. > }
    155.   
    156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/bio/bio_lib.c:69:9: Taking false branch
  67.       BIO *ret = OPENSSL_malloc(sizeof(*ret));
  68.   
  69.       if (ret == NULL) {
                ^
  70.           BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);
  71.           return (NULL);

crypto/bio/bio_lib.c:73:10: Taking false branch
  71.           return (NULL);
  72.       }
  73.       if (!BIO_set(ret, method)) {
                 ^
  74.           OPENSSL_free(ret);
  75.           ret = NULL;

crypto/bio/bio_lib.c:77:5: 
  75.           ret = NULL;
  76.       }
  77. >     return (ret);
  78.   }
  79.   

crypto/bio/bio_lib.c:78:1: return from a call to BIO_new
  76.       }
  77.       return (ret);
  78. > }
  79.   
  80.   int BIO_set(BIO *bio, BIO_METHOD *method)

apps/s_server.c:2697:10: Taking true branch
2695.       io = BIO_new(BIO_f_buffer());
2696.       ssl_bio = BIO_new(BIO_f_ssl());
2697.       if ((io == NULL) || (ssl_bio == NULL))
                 ^
2698.           goto err;
2699.   
