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


apps/s_server.c:2985:1: start of procedure rev_body()
2983.   }
2984.   
2985. > static int rev_body(char *hostname, int s, int stype, unsigned char *context)
2986.   {
2987.       char *buf = NULL;

apps/s_server.c:2987:5: 
2985.   static int rev_body(char *hostname, int s, int stype, unsigned char *context)
2986.   {
2987. >     char *buf = NULL;
2988.       int i;
2989.       int ret = 1;

apps/s_server.c:2989:5: 
2987.       char *buf = NULL;
2988.       int i;
2989. >     int ret = 1;
2990.       SSL *con;
2991.       BIO *io, *ssl_bio, *sbio;

apps/s_server.c:2993:5: 
2991.       BIO *io, *ssl_bio, *sbio;
2992.   
2993. >     buf = app_malloc(bufsize, "server rev buffer");
2994.       io = BIO_new(BIO_f_buffer());
2995.       ssl_bio = BIO_new(BIO_f_ssl());

apps/apps.c:976:1: start of procedure app_malloc()
  974.   }
  975.   
  976. > void* app_malloc(int sz, const char *what)
  977.   {
  978.       void *vp = OPENSSL_malloc(sz);

apps/apps.c:978:5: 
  976.   void* app_malloc(int sz, const char *what)
  977.   {
  978. >     void *vp = OPENSSL_malloc(sz);
  979.   
  980.       if (vp == NULL) {

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

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

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

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

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

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

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

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

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

apps/apps.c:980:9: Taking false branch
  978.       void *vp = OPENSSL_malloc(sz);
  979.   
  980.       if (vp == NULL) {
                 ^
  981.           BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n",
  982.                   opt_getprog(), sz, what);

apps/apps.c:986:5: 
  984.           exit(1);
  985.       }
  986. >     return vp;
  987.   }
  988.   

apps/apps.c:987:1: return from a call to app_malloc
  985.       }
  986.       return vp;
  987. > }
  988.   
  989.   /*

apps/s_server.c:2994:5: 
2992.   
2993.       buf = app_malloc(bufsize, "server rev buffer");
2994. >     io = BIO_new(BIO_f_buffer());
2995.       ssl_bio = BIO_new(BIO_f_ssl());
2996.       if ((io == NULL) || (ssl_bio == NULL))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

apps/s_server.c:2995:5: 
2993.       buf = app_malloc(bufsize, "server rev buffer");
2994.       io = BIO_new(BIO_f_buffer());
2995. >     ssl_bio = BIO_new(BIO_f_ssl());
2996.       if ((io == NULL) || (ssl_bio == NULL))
2997.           goto err;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

apps/s_server.c:2996:10: Taking true branch
2994.       io = BIO_new(BIO_f_buffer());
2995.       ssl_bio = BIO_new(BIO_f_ssl());
2996.       if ((io == NULL) || (ssl_bio == NULL))
                 ^
2997.           goto err;
2998.   
