[openssl-users] [openss-users] How to correctly shutdown for connection to avoid memory leak
Jeffrey Walton
noloader at gmail.com
Mon Apr 27 11:39:46 UTC 2015
> I am using openssl 1.0.2 to do some ssl connection, now I am facing
> some memory leak issue.
>
> ssl = SSL_new(m_ctx);
> sbio = BIO_new_socket(server, BIO_NOCLOSE);
> SSL_set_bio(ssl,sbio,sbio);
> ....
>
> SSL_connect()
> ...
>
> //After handle, release resource
> if(ssl)
> SSL_shutdown(ssl);
>
Also see Rescorla's An Introduction to OpenSSL Programming Part I
(http://www.rtfm.com/openssl-examples/part1.pdf) and An Introduction
to OpenSSL Programming Part II
(http://www.rtfm.com/openssl-examples/part2.pdf). They also show you
how to handle the return value from SSL_shutdown.
Jeff
More information about the openssl-users
mailing list