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
}
['int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,\n                    int nid_safe, int iter, char *pass)\n{\n    PKCS7 *p7 = NULL;\n    int free_safes = 0;\n    if (!*psafes) {\n        *psafes = sk_PKCS7_new_null();\n        if (!*psafes)\n            return 0;\n        free_safes = 1;\n    } else\n        free_safes = 0;\n    if (nid_safe == 0)\n#ifdef OPENSSL_NO_RC2\n        nid_safe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;\n#else\n        nid_safe = NID_pbe_WithSHA1And40BitRC2_CBC;\n#endif\n    if (nid_safe == -1)\n        p7 = PKCS12_pack_p7data(bags);\n    else\n        p7 = PKCS12_pack_p7encdata(nid_safe, pass, -1, NULL, 0, iter, bags);\n    if (!p7)\n        goto err;\n    if (!sk_PKCS7_push(*psafes, p7))\n        goto err;\n    return 1;\n err:\n    if (free_safes) {\n        sk_PKCS7_free(*psafes);\n        *psafes = NULL;\n    }\n    PKCS7_free(p7);\n    return 0;\n}', 'DEFINE_STACK_OF(PKCS7)', 'int sk_push(_STACK *st, void *data)\n{\n    return (sk_insert(st, data, st->num));\n}', 'int sk_insert(_STACK *st, void *data, int loc)\n{\n    char **s;\n    if (st == NULL)\n        return 0;\n    if (st->num_alloc <= st->num + 1) {\n        s = OPENSSL_realloc((char *)st->data,\n                            (unsigned int)sizeof(char *) * st->num_alloc * 2);\n        if (s == NULL)\n            return (0);\n        st->data = s;\n        st->num_alloc *= 2;\n    }\n    if ((loc >= (int)st->num) || (loc < 0))\n        st->data[st->num] = data;\n    else {\n        memmove(&(st->data[loc + 1]),\n                &(st->data[loc]), sizeof(char *) * (st->num - loc));\n        st->data[loc] = data;\n    }\n    st->num++;\n    st->sorted = 0;\n    return (st->num);\n}', 'void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)\n{\n    if (str == NULL)\n        return CRYPTO_malloc(num, file, line);\n    if (num == 0) {\n        CRYPTO_free(str);\n        return NULL;\n    }\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        void *ret;\n        CRYPTO_mem_debug_realloc(str, NULL, num, 0, file, line);\n        ret = realloc(str, num);\n        CRYPTO_mem_debug_realloc(str, ret, num, 1, file, line);\n        return ret;\n    }\n#else\n    (void)file;\n    (void)line;\n#endif\n    return realloc(str, num);\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}']