在使用
ssl::setup_ssl_lock();
SSL_load_error_strings();
SSL_library_init();
这几个接口的时候,会申请一部分内存,常常会被静态检查工具检查出来。如果是进程退出的话,我们完全不用管它,
如果是反复调用多次的话,那就需要处理了,请参考下面的链接;
13. I think I've detected a memory leak, is this a bug?
In most cases the cause of an apparent memory leak is an OpenSSL internal table that is allocated when an application starts up. Since such tables do not grow in size over time they are harmless.
These internal tables can be freed up when an application closes using various functions. Currently these include following:
Thread-local cleanup functions:
ERR_remove_state()
Application-global cleanup functions that are aware of usage (and therefore thread-safe):
ENGINE_cleanup() and CONF_modules_unload()
"Brutal" (thread-unsafe) Application-global cleanup functions:
ERR_free_strings(), EVP_cleanup() and CRYPTO_cleanup_all_ex_data().