EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,
                                        const char *pem_str, const char *info)
{
    EVP_PKEY_ASN1_METHOD *ameth = OPENSSL_zalloc(sizeof(*ameth));
    if (ameth == NULL)
        return NULL;
    ameth->pkey_id = id;
    ameth->pkey_base_id = id;
    ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC;
    if (info) {
        ameth->info = OPENSSL_strdup(info);
        if (!ameth->info)
            goto err;
    }
    if (pem_str) {
        ameth->pem_str = OPENSSL_strdup(pem_str);
        if (!ameth->pem_str)
            goto err;
    }
    return ameth;
 err:
    EVP_PKEY_asn1_free(ameth);
    return NULL;
}
['EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,\n                                        const char *pem_str, const char *info)\n{\n    EVP_PKEY_ASN1_METHOD *ameth = OPENSSL_zalloc(sizeof(*ameth));\n    if (ameth == NULL)\n        return NULL;\n    ameth->pkey_id = id;\n    ameth->pkey_base_id = id;\n    ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC;\n    if (info) {\n        ameth->info = OPENSSL_strdup(info);\n        if (!ameth->info)\n            goto err;\n    }\n    if (pem_str) {\n        ameth->pem_str = OPENSSL_strdup(pem_str);\n        if (!ameth->pem_str)\n            goto err;\n    }\n    return ameth;\n err:\n    EVP_PKEY_asn1_free(ameth);\n    return NULL;\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}', 'char *CRYPTO_strdup(const char *str, const char* file, int line)\n{\n    char *ret;\n    if (str == NULL)\n        return NULL;\n    ret = CRYPTO_malloc(strlen(str) + 1, file, line);\n    if (ret != NULL)\n        strcpy(ret, str);\n    return ret;\n}', 'void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)\n{\n    if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC)) {\n        OPENSSL_free(ameth->pem_str);\n        OPENSSL_free(ameth->info);\n        OPENSSL_free(ameth);\n    }\n}']