//
// _CONF_new_section from 0x8789fc to 0x878acc (208 bytes)
//
// 4 xrefs:
// > sub_8791C0 @ 0x879318
// > sub_8791C0 @ 0x879964
// > sub_8791C0 @ 0x879a74
// > ??> @ 0x6a6ec
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
_DWORD *__fastcall CONF_new_section(int a1, const char *a2)
{
void **v4; // r8
_DWORD *v5; // r4
void *v6; // r7
void *v7; // r0
int *v8; // r0
v4 = (void **)OPENSSL_sk_new_null();
if ( !v4 || (v5 = CRYPTO_malloc(&byte_9[3], (int)"crypto/conf/conf_api.c", 196)) == nullptr )
{
v5 = nullptr;
goto LABEL_7;
}
v6 = (void *)(strlen(a2) + 1);
v7 = CRYPTO_malloc(v6, (int)"crypto/conf/conf_api.c", 199);
*v5 = v7;
if ( !v7 )
{
LABEL_7:
OPENSSL_sk_free(v4);
CRYPTO_free(v5, (int)"crypto/conf/conf_api.c", 212);
return nullptr;
}
memcpy(v7, a2, (size_t)v6);
v8 = *(int **)(a1 + 8);
v5[2] = v4;
v5[1] = 0;
if ( OPENSSL_LH_insert(v8, (int)v5) )
OPENSSL_die("assertion failed: vv == NULL", "crypto/conf/conf_api.c", 207);
return v5;
}