Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
OpenSSL modules not freed #526
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.
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:
added a commit
Nov 13, 2015
Confirmed in Windows 7 x64 with OpenSSL_1_0_2d and curl master f322ca7 2015-11-13 curl-all.sln VS2010 in configuration 'DLL Debug - DLL OpenSSL|Win32'. Happens regardless of whether a conf file is present.
This can be solved by either unloading the modules or freeing them on cleanup. OpenSSL's doc says:
I'm sure they mean application closedown because they say so in OPENSSL_config. Even though we don't use that function we're doing pretty much the same thing so it makes sense that we would have to use CONF_modules_free.
Thanks, landed in ad2d517.
FYI, I also posted the missing details for the OPENSSL_load_builtin_modules docs to OpenSSL: https://rt.openssl.org/Ticket/Display.html?user=guest&pass=guest&id=4139