# HG changeset patch # User Matthew Wild # Date 1589283111 -3600 # Node ID 01545225895210d119620738b4116b2a92279414 # Parent b872f111b7af4ff0619be9d8ee60ac72950c5806 mod_firewall: Ensure file lists are always initialized empty diff -r b872f111b7af -r 015452258952 mod_firewall/definitions.lib.lua --- a/mod_firewall/definitions.lib.lua Mon May 11 17:18:30 2020 +0100 +++ b/mod_firewall/definitions.lib.lua Tue May 12 12:31:51 2020 +0100 @@ -148,8 +148,8 @@ -- %LIST: file:/path/to/file file = { init = function (self, file_spec, opts) - local items = {}; - local n = 0; + local n, items = 0, {}; + self.items = items; local filename = file_spec:gsub("^file:", ""); if opts.missing == "ignore" and not lfs.attributes(filename, "mode") then module:log("debug", "Ignoring missing list file: %s", filename); @@ -167,7 +167,6 @@ end end end - self.items = items; module:log("debug", "Loaded %d items from %s", n, filename); end; add = function (self, item)