void CRYPTO_free(void *str)
{
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
    if (call_malloc_debug) {
        CRYPTO_mem_debug_free(str, 0);
        free(str);
        CRYPTO_mem_debug_free(str, 1);
    } else {
        free(str);
    }
#else
    free(str);
#endif
}
['static int digest_test_run(struct evp_test *t)\n{\n    struct digest_data *mdata = t->data;\n    size_t i;\n    const char *err = "INTERNAL_ERROR";\n    EVP_MD_CTX *mctx;\n    unsigned char md[EVP_MAX_MD_SIZE];\n    unsigned int md_len;\n    mctx = EVP_MD_CTX_new();\n    if (!mctx)\n        goto err;\n    err = "DIGESTINIT_ERROR";\n    if (!EVP_DigestInit_ex(mctx, mdata->digest, NULL))\n        goto err;\n    err = "DIGESTUPDATE_ERROR";\n    for (i = 0; i < mdata->nrpt; i++) {\n        if (!EVP_DigestUpdate(mctx, mdata->input, mdata->input_len))\n            goto err;\n    }\n    err = "DIGESTFINAL_ERROR";\n    if (!EVP_DigestFinal(mctx, md, &md_len))\n        goto err;\n    err = "DIGEST_LENGTH_MISMATCH";\n    if (md_len != mdata->output_len)\n        goto err;\n    err = "DIGEST_MISMATCH";\n    if (check_output(t, mdata->output, md, md_len))\n        goto err;\n    err = NULL;\n err:\n    EVP_MD_CTX_free(mctx);\n    t->err = err;\n    return 1;\n}', 'int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)\n{\n    EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);\n#ifndef OPENSSL_NO_ENGINE\n    if (ctx->engine && ctx->digest && (!type ||\n                                       (type\n                                        && (type->type ==\n                                            ctx->digest->type))))\n        goto skip_to_init;\n    if (type) {\n        if (ctx->engine)\n            ENGINE_finish(ctx->engine);\n        if (impl) {\n            if (!ENGINE_init(impl)) {\n                EVPerr(EVP_F_EVP_DIGESTINIT_EX, EVP_R_INITIALIZATION_ERROR);\n                return 0;\n            }\n        } else\n            impl = ENGINE_get_digest_engine(type->type);\n        if (impl) {\n            const EVP_MD *d = ENGINE_get_digest(impl, type->type);\n            if (!d) {\n                EVPerr(EVP_F_EVP_DIGESTINIT_EX, EVP_R_INITIALIZATION_ERROR);\n                ENGINE_finish(impl);\n                return 0;\n            }\n            type = d;\n            ctx->engine = impl;\n        } else\n            ctx->engine = NULL;\n    } else {\n        if (!ctx->digest) {\n            EVPerr(EVP_F_EVP_DIGESTINIT_EX, EVP_R_NO_DIGEST_SET);\n            return 0;\n        }\n        type = ctx->digest;\n    }\n#endif\n    if (ctx->digest != type) {\n        if (ctx->digest && ctx->digest->ctx_size)\n            OPENSSL_free(ctx->md_data);\n        ctx->digest = type;\n        if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) {\n            ctx->update = type->update;\n            ctx->md_data = OPENSSL_malloc(type->ctx_size);\n            if (ctx->md_data == NULL) {\n                EVPerr(EVP_F_EVP_DIGESTINIT_EX, ERR_R_MALLOC_FAILURE);\n                return 0;\n            }\n        }\n    }\n#ifndef OPENSSL_NO_ENGINE\n skip_to_init:\n#endif\n    if (ctx->pctx) {\n        int r;\n        r = EVP_PKEY_CTX_ctrl(ctx->pctx, -1, EVP_PKEY_OP_TYPE_SIG,\n                              EVP_PKEY_CTRL_DIGESTINIT, 0, ctx);\n        if (r <= 0 && (r != -2))\n            return 0;\n    }\n    if (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT)\n        return 1;\n    return ctx->digest->init(ctx);\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}']