Skip to content

OpenSSL modules not freed #526

@pohly05

Description

@pohly05

I'm not sure why this behaviour happens, but I detected a Memory leak in CURL (7.44.0 - but I think it's the same with 7.45.0) with OpenSSL in a Win32 application on Windows 7.

Curl_ossl_init calls OPENSSL_load_builtin_modules() but Curl_ossl_cleanup doesn't make a call to free these modules.

openssl.c: 697
int Curl_ossl_init(void)
{
OPENSSL_load_builtin_modules();
...

I was able to fix that by adding CONF_modules_free(); at the end of Curl_ossl_cleanup.

Here's the main part of the Stacktrace:
module_add(dso_st * dso, const char * name, int (conf_imodule_st *, const conf_st *) * ifunc, void (conf_imodule_st *) * ffunc) Zeile 282 C
CONF_module_add(const char * name, int (conf_imodule_st *, const conf_st *) * ifunc, void (conf_imodule_st *) * ffunc) Zeile 463 C
ASN1_add_oid_module() Zeile 100 C
OPENSSL_load_builtin_modules() Zeile 78 C
Curl_ossl_init() Zeile 706 C
Curl_ssl_init() Zeile 266 C
curl_global_init(long flags) Zeile 239 C
setupGlobalConstants(_xmlrpc_env * const envP) Zeile 1508 C
callTransportSetup(_xmlrpc_env * const envP, void (_xmlrpc_env * const) * setupFn) Zeile 93 C
setupTransportGlobalConst(_xmlrpc_env * const envP) Zeile 109 C
xmlrpc_client_setup_global_const(_xmlrpc_env * const envP) Zeile 167 C
xmlrpc_client_init2(_xmlrpc_env * const envP, const int flags, const char * const appname, const char * const appversion, const xmlrpc_clientparms * const clientparmsP, const unsigned int parmSize) Zeile 38 C
XmlRpcClient::Initialize(std::basic_string<char,std::char_traits,std::allocator > appname, std::basic_string<char,std::char_traits,std::allocator > appversion, std::basic_string<char,std::char_traits,std::allocator > cainfo) Zeile 313 C++

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions