diff --git a/src/CommandSupport.go b/src/CommandSupport.go index 6a26b08..d581586 100644 --- a/src/CommandSupport.go +++ b/src/CommandSupport.go @@ -140,10 +140,10 @@ func initCommandAllowList() { if len(allowList) == 0 { var allowListFile []string commandAllowListFile, err := os.Open(commandAllowListLocation) - defer commandAllowListFile.Close() if err != nil { log.Println("[error] getAllowList error with COMMANDS_ALLOWLIST: " + commandAllowListLocation + " not found and will be ignored") } else { + defer commandAllowListFile.Close() byteValue, err := ioutil.ReadAll(commandAllowListFile) if err != nil { log.Println("[error] getAllowList error while reading COMMANDS_ALLOWLIST: " + commandAllowListLocation + " it will be ignored")