changeset 1534:13d5d23a5344 stable-0.5

r1500 merge: fix file leak for HEAD requests
author Igor Sysoev <igor@sysoev.ru>
date Sun, 23 Sep 2007 19:30:51 +0000
parents 9b10ba85b249
children d82f8d4ed369
files src/http/modules/ngx_http_autoindex_module.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_autoindex_module.c
+++ b/src/http/modules/ngx_http_autoindex_module.c
@@ -236,6 +236,11 @@ ngx_http_autoindex_handler(ngx_http_requ
     rc = ngx_http_send_header(r);
 
     if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
+        if (ngx_close_dir(&dir) == NGX_ERROR) {
+            ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno,
+                          ngx_close_dir_n " \"%V\" failed", &path);
+        }
+
         return rc;
     }