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


apps/s_server.c:2972:1: start of procedure rev_body()
2970.   }
2971.   
2972. > static int rev_body(char *hostname, int s, int stype, unsigned char *context)
2973.   {
2974.       char *buf = NULL;

apps/s_server.c:2974:5: 
2972.   static int rev_body(char *hostname, int s, int stype, unsigned char *context)
2973.   {
2974. >     char *buf = NULL;
2975.       int i;
2976.       int ret = 1;

apps/s_server.c:2976:5: 
2974.       char *buf = NULL;
2975.       int i;
2976. >     int ret = 1;
2977.       SSL *con;
2978.       BIO *io, *ssl_bio, *sbio;

apps/s_server.c:2980:5: 
2978.       BIO *io, *ssl_bio, *sbio;
2979.   
2980. >     buf = app_malloc(bufsize, "server rev buffer");
2981.       io = BIO_new(BIO_f_buffer());
2982.       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:2981:5: 
2979.   
2980.       buf = app_malloc(bufsize, "server rev buffer");
2981. >     io = BIO_new(BIO_f_buffer());
2982.       ssl_bio = BIO_new(BIO_f_ssl());
2983.       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:2982:5: 
2980.       buf = app_malloc(bufsize, "server rev buffer");
2981.       io = BIO_new(BIO_f_buffer());
2982. >     ssl_bio = BIO_new(BIO_f_ssl());
2983.       if ((io == NULL) || (ssl_bio == NULL))
2984.           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:2983:10: Taking true branch
2981.       io = BIO_new(BIO_f_buffer());
2982.       ssl_bio = BIO_new(BIO_f_ssl());
2983.       if ((io == NULL) || (ssl_bio == NULL))
                 ^
2984.           goto err;
2985.   

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}']