From 754b44989fd07079f2940ec3e30af20411c7136d Mon Sep 17 00:00:00 2001 From: Argishti Rostamian <1332785+WhileLoop@users.noreply.github.com> Date: Thu, 24 Oct 2019 11:52:14 -0700 Subject: [PATCH] Close file descriptor returned by request.FormFile (#1411) --- context.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/context.go b/context.go index b6d38232..91e7c046 100644 --- a/context.go +++ b/context.go @@ -347,7 +347,8 @@ func (c *context) FormParams() (url.Values, error) { } func (c *context) FormFile(name string) (*multipart.FileHeader, error) { - _, fh, err := c.request.FormFile(name) + f, fh, err := c.request.FormFile(name) + defer f.Close() return fh, err }