From b878527151e6503d24ac5b667b86e8794eb79ff7 Mon Sep 17 00:00:00 2001 From: Pablo Caderno Date: Wed, 6 Oct 2021 22:02:46 +1100 Subject: [PATCH] Added deferred close to 'http.File' opened (#9443) (#9461) Signed-off-by: Pablo Caderno --- web/web.go | 1 + 1 file changed, 1 insertion(+) diff --git a/web/web.go b/web/web.go index c5e2a2216..db0069fb6 100644 --- a/web/web.go +++ b/web/web.go @@ -397,6 +397,7 @@ func New(logger log.Logger, o *Options) *Handler { fmt.Fprintf(w, "Error opening React index.html: %v", err) return } + defer func() { _ = f.Close() }() idx, err := ioutil.ReadAll(f) if err != nil { w.WriteHeader(http.StatusInternalServerError)