# HG changeset patch # User Kim Alvefur # Date 1356073807 -3600 # Node ID 6209b9a0244be476d98d73975eb1e19a2e58a653 # Parent 6d8ec8c90240746b038a346c99d5e03840f8a39b mod_http_files: No use in closing a file handle if we couldn't open it diff -r 6d8ec8c90240 -r 6209b9a0244b plugins/mod_http_files.lua --- a/plugins/mod_http_files.lua Sun Dec 16 14:36:24 2012 +0100 +++ b/plugins/mod_http_files.lua Fri Dec 21 08:10:07 2012 +0100 @@ -106,9 +106,11 @@ end else - local f = open(full_path, "rb"); - data = f and f:read("*a"); - f:close(); + local f, err = open(full_path, "rb"); + if f then + data = f:read("*a"); + f:close(); + end if not data then return 403; end