static int addrinfo_wrap(int family, int socktype,
                         const void *where, size_t wherelen,
                         unsigned short port,
                         BIO_ADDRINFO **bai)
{
    OPENSSL_assert(bai != NULL);
    *bai = (BIO_ADDRINFO *)OPENSSL_zalloc(sizeof(**bai));
    if (*bai == NULL)
        return 0;
    (*bai)->bai_family = family;
    (*bai)->bai_socktype = socktype;
    if (socktype == SOCK_STREAM)
        (*bai)->bai_protocol = IPPROTO_TCP;
    if (socktype == SOCK_DGRAM)
        (*bai)->bai_protocol = IPPROTO_UDP;
#ifdef AF_UNIX
    if (family == AF_UNIX)
        (*bai)->bai_protocol = 0;
#endif
    {
        BIO_ADDR *addr = BIO_ADDR_new();
        if (addr != NULL) {
            BIO_ADDR_rawmake(addr, family, where, wherelen, port);
            (*bai)->bai_addr = BIO_ADDR_sockaddr_noconst(addr);
        }
    }
    (*bai)->bai_next = NULL;
    if ((*bai)->bai_addr == NULL) {
        BIO_ADDRINFO_free(*bai);
        *bai = NULL;
        return 0;
    }
    return 1;
}
['static int addrinfo_wrap(int family, int socktype,\n                         const void *where, size_t wherelen,\n                         unsigned short port,\n                         BIO_ADDRINFO **bai)\n{\n    OPENSSL_assert(bai != NULL);\n    *bai = (BIO_ADDRINFO *)OPENSSL_zalloc(sizeof(**bai));\n    if (*bai == NULL)\n        return 0;\n    (*bai)->bai_family = family;\n    (*bai)->bai_socktype = socktype;\n    if (socktype == SOCK_STREAM)\n        (*bai)->bai_protocol = IPPROTO_TCP;\n    if (socktype == SOCK_DGRAM)\n        (*bai)->bai_protocol = IPPROTO_UDP;\n#ifdef AF_UNIX\n    if (family == AF_UNIX)\n        (*bai)->bai_protocol = 0;\n#endif\n    {\n        BIO_ADDR *addr = BIO_ADDR_new();\n        if (addr != NULL) {\n            BIO_ADDR_rawmake(addr, family, where, wherelen, port);\n            (*bai)->bai_addr = BIO_ADDR_sockaddr_noconst(addr);\n        }\n    }\n    (*bai)->bai_next = NULL;\n    if ((*bai)->bai_addr == NULL) {\n        BIO_ADDRINFO_free(*bai);\n        *bai = NULL;\n        return 0;\n    }\n    return 1;\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\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_ADDR *BIO_ADDR_new(void)\n{\n    BIO_ADDR *ret = (BIO_ADDR *)OPENSSL_zalloc(sizeof(BIO_ADDR));\n    return ret;\n}']