static apr_status_t ssl_init_cleanup()

in native/src/ssl.c [150:186]


static apr_status_t ssl_init_cleanup(void *data)
{
    UNREFERENCED(data);

    if (!ssl_initialized)
        return APR_SUCCESS;
    ssl_initialized = 0;

    free_bio_methods();
    free_dh_params();

#ifndef OPENSSL_NO_ENGINE
    if (tcn_ssl_engine != NULL) {
        /* Release the SSL Engine structural reference */
        ENGINE_free(tcn_ssl_engine);
        tcn_ssl_engine = NULL;
    }
#endif

    /* Openssl v1.1+ handles all termination automatically. */

    if (key_log_file) {
        BIO_free(key_log_file);
        key_log_file = NULL;
    }

    /* Don't call ERR_free_strings here; ERR_load_*_strings only
     * actually load the error strings once per process due to static
     * variable abuse in OpenSSL. */

    /*
     * TODO: determine somewhere we can safely shove out diagnostics
     *       (when enabled) at this late stage in the game:
     * CRYPTO_mem_leaks_fp(stderr);
     */
    return APR_SUCCESS;
}