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


apps/s_server.c:2989:1: start of procedure rev_body()
2987.   }
2988.   
2989. > static int rev_body(char *hostname, int s, int stype, unsigned char *context)
2990.   {
2991.       char *buf = NULL;

apps/s_server.c:2991:5: 
2989.   static int rev_body(char *hostname, int s, int stype, unsigned char *context)
2990.   {
2991. >     char *buf = NULL;
2992.       int i;
2993.       int ret = 1;

apps/s_server.c:2993:5: 
2991.       char *buf = NULL;
2992.       int i;
2993. >     int ret = 1;
2994.       SSL *con;
2995.       BIO *io, *ssl_bio, *sbio;

apps/s_server.c:2997:5: 
2995.       BIO *io, *ssl_bio, *sbio;
2996.   
2997. >     buf = app_malloc(bufsize, "server rev buffer");
2998.       io = BIO_new(BIO_f_buffer());
2999.       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:2998:5: 
2996.   
2997.       buf = app_malloc(bufsize, "server rev buffer");
2998. >     io = BIO_new(BIO_f_buffer());
2999.       ssl_bio = BIO_new(BIO_f_ssl());
3000.       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:2999:5: 
2997.       buf = app_malloc(bufsize, "server rev buffer");
2998.       io = BIO_new(BIO_f_buffer());
2999. >     ssl_bio = BIO_new(BIO_f_ssl());
3000.       if ((io == NULL) || (ssl_bio == NULL))
3001.           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:3000:10: Taking true branch
2998.       io = BIO_new(BIO_f_buffer());
2999.       ssl_bio = BIO_new(BIO_f_ssl());
3000.       if ((io == NULL) || (ssl_bio == NULL))
                 ^
3001.           goto err;
3002.   

static int rev_body(char *hostname, int s, int stype, unsigned char *context)
{
    char *buf = NULL;
    int i;
    int ret = 1;
    SSL *con;
    BIO *io, *ssl_bio, *sbio;
    buf = app_malloc(bufsize, "server rev buffer");
    io = BIO_new(BIO_f_buffer());
    ssl_bio = BIO_new(BIO_f_ssl());
    if ((io == NULL) || (ssl_bio == NULL))
        goto err;
    if (!BIO_set_write_buffer_size(io, bufsize))
        goto err;
    if ((con = SSL_new(ctx)) == NULL)
        goto err;
    if (s_tlsextdebug) {
        SSL_set_tlsext_debug_callback(con, tlsext_cb);
        SSL_set_tlsext_debug_arg(con, bio_s_out);
    }
    if (context && !SSL_set_session_id_context(con, context,
                        strlen((char *)context))) {
        ERR_print_errors(bio_err);
        goto err;
    }
    sbio = BIO_new_socket(s, BIO_NOCLOSE);
    SSL_set_bio(con, sbio, sbio);
    SSL_set_accept_state(con);
    BIO_set_ssl(ssl_bio, con, BIO_CLOSE);
    BIO_push(io, ssl_bio);
#ifdef CHARSET_EBCDIC
    io = BIO_push(BIO_new(BIO_f_ebcdic_filter()), io);
#endif
    if (s_debug) {
        BIO_set_callback(SSL_get_rbio(con), bio_dump_callback);
        BIO_set_callback_arg(SSL_get_rbio(con), (char *)bio_s_out);
    }
    if (s_msg) {
#ifndef OPENSSL_NO_SSL_TRACE
        if (s_msg == 2)
            SSL_set_msg_callback(con, SSL_trace);
        else
#endif
            SSL_set_msg_callback(con, msg_cb);
        SSL_set_msg_callback_arg(con, bio_s_msg ? bio_s_msg : bio_s_out);
    }
    for (;;) {
        i = BIO_do_handshake(io);
        if (i > 0)
            break;
        if (!BIO_should_retry(io)) {
            BIO_puts(bio_err, "CONNECTION FAILURE\n");
            ERR_print_errors(bio_err);
            goto end;
        }
#ifndef OPENSSL_NO_SRP
        if (BIO_should_io_special(io)
            && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
            BIO_printf(bio_s_out, "LOOKUP renego during accept\n");
            srp_callback_parm.user =
                SRP_VBASE_get_by_user(srp_callback_parm.vb,
                                      srp_callback_parm.login);
            if (srp_callback_parm.user)
                BIO_printf(bio_s_out, "LOOKUP done %s\n",
                           srp_callback_parm.user->info);
            else
                BIO_printf(bio_s_out, "LOOKUP not successful\n");
            continue;
        }
#endif
    }
    BIO_printf(bio_err, "CONNECTION ESTABLISHED\n");
    print_ssl_summary(con);
    for (;;) {
        i = BIO_gets(io, buf, bufsize - 1);
        if (i < 0) {
            if (!BIO_should_retry(io)) {
                if (!s_quiet)
                    ERR_print_errors(bio_err);
                goto err;
            } else {
                BIO_printf(bio_s_out, "read R BLOCK\n");
#ifndef OPENSSL_NO_SRP
                if (BIO_should_io_special(io)
                    && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
                    BIO_printf(bio_s_out, "LOOKUP renego during read\n");
                    srp_callback_parm.user =
                        SRP_VBASE_get_by_user(srp_callback_parm.vb,
                                              srp_callback_parm.login);
                    if (srp_callback_parm.user)
                        BIO_printf(bio_s_out, "LOOKUP done %s\n",
                                   srp_callback_parm.user->info);
                    else
                        BIO_printf(bio_s_out, "LOOKUP not successful\n");
                    continue;
                }
#endif
#if defined(OPENSSL_SYS_NETWARE)
                delay(1000);
#elif !defined(OPENSSL_SYS_MSDOS)
                sleep(1);
#endif
                continue;
            }
        } else if (i == 0) {
            ret = 1;
            BIO_printf(bio_err, "CONNECTION CLOSED\n");
            goto end;
        } else {
            char *p = buf + i - 1;
            while (i && (*p == '\n' || *p == '\r')) {
                p--;
                i--;
            }
            if (!s_ign_eof && (i == 5) && (strncmp(buf, "CLOSE", 5) == 0)) {
                ret = 1;
                BIO_printf(bio_err, "CONNECTION CLOSED\n");
                goto end;
            }
            BUF_reverse((unsigned char *)buf, NULL, i);
            buf[i] = '\n';
            BIO_write(io, buf, i + 1);
            for (;;) {
                i = BIO_flush(io);
                if (i > 0)
                    break;
                if (!BIO_should_retry(io))
                    goto end;
            }
        }
    }
 end:
    SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
 err:
    OPENSSL_free(buf);
    BIO_free_all(io);
    return (ret);
}
['static int rev_body(char *hostname, int s, int stype, unsigned char *context)\n{\n    char *buf = NULL;\n    int i;\n    int ret = 1;\n    SSL *con;\n    BIO *io, *ssl_bio, *sbio;\n    buf = app_malloc(bufsize, "server rev buffer");\n    io = BIO_new(BIO_f_buffer());\n    ssl_bio = BIO_new(BIO_f_ssl());\n    if ((io == NULL) || (ssl_bio == NULL))\n        goto err;\n    if (!BIO_set_write_buffer_size(io, bufsize))\n        goto err;\n    if ((con = SSL_new(ctx)) == NULL)\n        goto err;\n    if (s_tlsextdebug) {\n        SSL_set_tlsext_debug_callback(con, tlsext_cb);\n        SSL_set_tlsext_debug_arg(con, bio_s_out);\n    }\n    if (context && !SSL_set_session_id_context(con, context,\n                        strlen((char *)context))) {\n        ERR_print_errors(bio_err);\n        goto err;\n    }\n    sbio = BIO_new_socket(s, BIO_NOCLOSE);\n    SSL_set_bio(con, sbio, sbio);\n    SSL_set_accept_state(con);\n    BIO_set_ssl(ssl_bio, con, BIO_CLOSE);\n    BIO_push(io, ssl_bio);\n#ifdef CHARSET_EBCDIC\n    io = BIO_push(BIO_new(BIO_f_ebcdic_filter()), io);\n#endif\n    if (s_debug) {\n        BIO_set_callback(SSL_get_rbio(con), bio_dump_callback);\n        BIO_set_callback_arg(SSL_get_rbio(con), (char *)bio_s_out);\n    }\n    if (s_msg) {\n#ifndef OPENSSL_NO_SSL_TRACE\n        if (s_msg == 2)\n            SSL_set_msg_callback(con, SSL_trace);\n        else\n#endif\n            SSL_set_msg_callback(con, msg_cb);\n        SSL_set_msg_callback_arg(con, bio_s_msg ? bio_s_msg : bio_s_out);\n    }\n    for (;;) {\n        i = BIO_do_handshake(io);\n        if (i > 0)\n            break;\n        if (!BIO_should_retry(io)) {\n            BIO_puts(bio_err, "CONNECTION FAILURE\\n");\n            ERR_print_errors(bio_err);\n            goto end;\n        }\n#ifndef OPENSSL_NO_SRP\n        if (BIO_should_io_special(io)\n            && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {\n            BIO_printf(bio_s_out, "LOOKUP renego during accept\\n");\n            srp_callback_parm.user =\n                SRP_VBASE_get_by_user(srp_callback_parm.vb,\n                                      srp_callback_parm.login);\n            if (srp_callback_parm.user)\n                BIO_printf(bio_s_out, "LOOKUP done %s\\n",\n                           srp_callback_parm.user->info);\n            else\n                BIO_printf(bio_s_out, "LOOKUP not successful\\n");\n            continue;\n        }\n#endif\n    }\n    BIO_printf(bio_err, "CONNECTION ESTABLISHED\\n");\n    print_ssl_summary(con);\n    for (;;) {\n        i = BIO_gets(io, buf, bufsize - 1);\n        if (i < 0) {\n            if (!BIO_should_retry(io)) {\n                if (!s_quiet)\n                    ERR_print_errors(bio_err);\n                goto err;\n            } else {\n                BIO_printf(bio_s_out, "read R BLOCK\\n");\n#ifndef OPENSSL_NO_SRP\n                if (BIO_should_io_special(io)\n                    && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {\n                    BIO_printf(bio_s_out, "LOOKUP renego during read\\n");\n                    srp_callback_parm.user =\n                        SRP_VBASE_get_by_user(srp_callback_parm.vb,\n                                              srp_callback_parm.login);\n                    if (srp_callback_parm.user)\n                        BIO_printf(bio_s_out, "LOOKUP done %s\\n",\n                                   srp_callback_parm.user->info);\n                    else\n                        BIO_printf(bio_s_out, "LOOKUP not successful\\n");\n                    continue;\n                }\n#endif\n#if defined(OPENSSL_SYS_NETWARE)\n                delay(1000);\n#elif !defined(OPENSSL_SYS_MSDOS)\n                sleep(1);\n#endif\n                continue;\n            }\n        } else if (i == 0) {\n            ret = 1;\n            BIO_printf(bio_err, "CONNECTION CLOSED\\n");\n            goto end;\n        } else {\n            char *p = buf + i - 1;\n            while (i && (*p == \'\\n\' || *p == \'\\r\')) {\n                p--;\n                i--;\n            }\n            if (!s_ign_eof && (i == 5) && (strncmp(buf, "CLOSE", 5) == 0)) {\n                ret = 1;\n                BIO_printf(bio_err, "CONNECTION CLOSED\\n");\n                goto end;\n            }\n            BUF_reverse((unsigned char *)buf, NULL, i);\n            buf[i] = \'\\n\';\n            BIO_write(io, buf, i + 1);\n            for (;;) {\n                i = BIO_flush(io);\n                if (i > 0)\n                    break;\n                if (!BIO_should_retry(io))\n                    goto end;\n            }\n        }\n    }\n end:\n    SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);\n err:\n    OPENSSL_free(buf);\n    BIO_free_all(io);\n    return (ret);\n}', 'void* app_malloc(int sz, const char *what)\n{\n    void *vp = OPENSSL_malloc(sz);\n    if (vp == NULL) {\n        BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\\n",\n                opt_getprog(), sz, what);\n        ERR_print_errors(bio_err);\n        exit(1);\n    }\n    return vp;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}', 'BIO_METHOD *BIO_f_buffer(void)\n{\n    return (&methods_buffer);\n}', 'BIO *BIO_new(BIO_METHOD *method)\n{\n    BIO *ret = OPENSSL_malloc(sizeof(*ret));\n    if (ret == NULL) {\n        BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    if (!BIO_set(ret, method)) {\n        OPENSSL_free(ret);\n        ret = NULL;\n    }\n    return (ret);\n}', 'void CRYPTO_free(void *str)\n{\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}', 'BIO_METHOD *BIO_f_ssl(void)\n{\n    return (&methods_sslp);\n}']