diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-04-23 18:57:25 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-04-23 18:57:25 +0000 |
commit | 439e288a1bac3ca33153c75a699087de9e100e50 (patch) | |
tree | bd985c8606ea112d0f77da13f4341c105ae4cfac /src/http/ngx_http_request.c | |
parent | 6a2ea3f54430625120fc31556860531d2859eac7 (diff) | |
download | nginx-439e288a1bac3ca33153c75a699087de9e100e50.tar.gz nginx-439e288a1bac3ca33153c75a699087de9e100e50.zip |
fix memory leak when ssl_verify_client is on
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index d87f77d54..b248321e2 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1419,6 +1419,7 @@ ngx_http_process_request(ngx_http_request_t *r) if (c->ssl) { long rc; + X509 *cert; ngx_http_ssl_srv_conf_t *sscf; sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module); @@ -1438,9 +1439,9 @@ ngx_http_process_request(ngx_http_request_t *r) return; } - if (SSL_get_peer_certificate(c->ssl->connection) - == NULL) - { + cert = SSL_get_peer_certificate(c->ssl->connection); + + if (cert == NULL) { ngx_log_error(NGX_LOG_INFO, c->log, 0, "client sent no required SSL certificate"); @@ -1450,6 +1451,8 @@ ngx_http_process_request(ngx_http_request_t *r) ngx_http_finalize_request(r, NGX_HTTPS_NO_CERT); return; } + + X509_free(cert); } } |