From b998347f3361f4112c2585dc1d3da407e1bd9640 Mon Sep 17 00:00:00 2001 From: cws Date: Tue, 6 Jun 2017 05:57:33 -0400 Subject: [PATCH] stats: forgot to close the file in web serving --- plugins/stats/stats.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/stats/stats.go b/plugins/stats/stats.go index d6c4729..4bf4c9e 100644 --- a/plugins/stats/stats.go +++ b/plugins/stats/stats.go @@ -217,6 +217,7 @@ func (p *StatsPlugin) Help(e string, m []string) { func (p *StatsPlugin) serveQuery(w http.ResponseWriter, r *http.Request) { f, err := os.Open(p.bot.Config().Stats.DBPath) + defer f.Close() if err != nil { log.Printf("Error opening DB for web service: %s", err) fmt.Fprintf(w, "Error opening DB")