changeset 1499:090e391f53db

fix file leak for HEAD requests
author Igor Sysoev <igor@sysoev.ru>
date Sat, 22 Sep 2007 17:56:05 +0000
parents d23d9b5969e7
children 451b02cc770a
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;
     }