[PATCH] SSL: fixed possible memory and file descriptor leak on HUP signal.

Maxim Dounin mdounin at mdounin.ru
Thu Sep 19 13:26:41 UTC 2013


Hello!

On Wed, Sep 18, 2013 at 04:55:25PM -0700, Piotr Sikora wrote:

> # HG changeset patch
> # User Piotr Sikora <piotr at cloudflare.com>
> # Date 1379548290 25200
> #      Wed Sep 18 16:51:30 2013 -0700
> # Node ID c0be8de389be2012875a19a812ebf3ccc66c147d
> # Parent  e8d24b6d7f7304df77ccde7fc8223434c91b5322
> SSL: fixed possible memory and file descriptor leak on HUP signal.
> 
> The problem appeared in 386a06a22c40 (1.3.7).
> 
> Signed-off-by: Piotr Sikora <piotr at cloudflare.com>
> 
> diff -r e8d24b6d7f73 -r c0be8de389be src/event/ngx_event_openssl.c
> --- a/src/event/ngx_event_openssl.c     Wed Sep 18 18:53:26 2013 +0400
> +++ b/src/event/ngx_event_openssl.c     Wed Sep 18 16:51:30 2013 -0700
> @@ -280,6 +280,8 @@ ngx_ssl_certificate(ngx_conf_t *cf, ngx_
>      {
>          ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
>                        "SSL_CTX_set_ex_data() failed");
> +        X509_free(x509);
> +        BIO_free(bio);
>          return NGX_ERROR;
>      }

Committed, thanks.

-- 
Maxim Dounin
http://nginx.org/en/donation.html



More information about the nginx-devel mailing list