libimobiledevice/libimobiledevice — pull request #105 by UnveN (2014-08-21 06:38:17+00:00)
Title: Fixed several memory leaks on deinit of OpenSSL

You might also consider to include additional deinit procedures of OpenSSL to the internal_idevice_deinit(). In my case adding these lines was enough to eliminate most of a detected leaks
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
but there are also some other procedures in OpenSSL doing deinit job, some of them are
CONF_modules_free();
ERR_remove_state(0);
ENGINE_cleanup();
CONF_modules_unload(1);
ERR_free_strings();