[nginx] Resolver: free TCP buffers on resolver cleanup.

Roman Arutyunyan arut at nginx.com
Tue Feb 2 10:44:00 UTC 2016


details:   http://hg.nginx.org/nginx/rev/06459bc8b92f
branches:  
changeset: 6369:06459bc8b92f
user:      Roman Arutyunyan <arut at nginx.com>
date:      Tue Feb 02 13:42:55 2016 +0300
description:
Resolver: free TCP buffers on resolver cleanup.

diffstat:

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

diffs (20 lines):

diff -r d73f77bb5caf -r 06459bc8b92f src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c	Tue Feb 02 11:35:19 2016 +0300
+++ b/src/core/ngx_resolver.c	Tue Feb 02 13:42:55 2016 +0300
@@ -295,6 +295,16 @@ ngx_resolver_cleanup(void *data)
             if (rec[i].tcp) {
                 ngx_close_connection(rec[i].tcp);
             }
+
+            if (rec[i].read_buf) {
+                ngx_resolver_free(r, rec[i].read_buf->start);
+                ngx_resolver_free(r, rec[i].read_buf);
+            }
+
+            if (rec[i].write_buf) {
+                ngx_resolver_free(r, rec[i].write_buf->start);
+                ngx_resolver_free(r, rec[i].write_buf);
+            }
         }
 
         ngx_free(r);



More information about the nginx-devel mailing list