[openss-users] How to correctly shutdown for connection to avoid memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux