On Fri, May 22, 2015 at 6:29 PM, Rainer Jung <rainer.j...@kippdata.de> wrote:
> 1) In other code I see
>
>     EC_KEY_free(ecdh);
>
> after
>
>   EC_KEY *ecdh = EC_KEY_new_by_curve_name(...)
> and using ecdh, e.g. in
>   SSL_CTX_set_tmp_ecdh(mctx->ssl_ctx, eckey);
>
> Should we add the free? Or is it not needed? Anyone knows why?

This was added in r1666363:

* mod_ssl: fix small memory leak in ssl_init_server_certs when ECDH is used.
SSL_CTX_set_tmp_ecdh increases reference count, so we have to call EC_KEY_free,
otherwise eckey will not be freed.

Regards,
Yann.

Reply via email to