]> git.kaiwu.me - nginx.git/commitdiff
r1500 merge:
authorIgor Sysoev <igor@sysoev.ru>
Sun, 23 Sep 2007 19:30:51 +0000 (19:30 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sun, 23 Sep 2007 19:30:51 +0000 (19:30 +0000)
fix file leak for HEAD requests

src/http/modules/ngx_http_autoindex_module.c

index e08e63c8f116bce169652e7b7af6e13327cc2e12..ae9eaabbb058d248edf99017723b4ecbe03c76cd 100644 (file)
@@ -236,6 +236,11 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
     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;
     }