[nginx] Resolver: fixed possible resource leak introduced in 5a1...

Ruslan Ermilov ru at nginx.com
Tue Feb 2 08:35:35 UTC 2016


details:   http://hg.nginx.org/nginx/rev/d73f77bb5caf
branches:  
changeset: 6368:d73f77bb5caf
user:      Ruslan Ermilov <ru at nginx.com>
date:      Tue Feb 02 11:35:19 2016 +0300
description:
Resolver: fixed possible resource leak introduced in 5a16d40c63de.

Found by Coverity (CID 1351175).

diffstat:

 src/core/ngx_resolver.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r 5a16d40c63de -r d73f77bb5caf src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c	Thu Jan 28 15:28:20 2016 +0300
+++ b/src/core/ngx_resolver.c	Tue Feb 02 11:35:19 2016 +0300
@@ -1215,6 +1215,7 @@ ngx_resolver_send_tcp_query(ngx_resolver
 
             b->start = ngx_resolver_alloc(r, NGX_RESOLVER_TCP_RSIZE);
             if (b->start == NULL) {
+                ngx_resolver_free(r, b);
                 return NGX_ERROR;
             }
 
@@ -1236,6 +1237,7 @@ ngx_resolver_send_tcp_query(ngx_resolver
 
             b->start = ngx_resolver_alloc(r, NGX_RESOLVER_TCP_WSIZE);
             if (b->start == NULL) {
+                ngx_resolver_free(r, b);
                 return NGX_ERROR;
             }
 



More information about the nginx-devel mailing list