[FIX] c.Request.FormFile maybe file, need close (#2114)

This commit is contained in:
linfangrong 2019-10-31 23:17:12 +08:00 committed by thinkerou
parent aabaccbba2
commit 0f951956d0
1 changed files with 5 additions and 1 deletions

View File

@ -516,7 +516,11 @@ func (c *Context) FormFile(name string) (*multipart.FileHeader, error) {
return nil, err
}
}
_, fh, err := c.Request.FormFile(name)
f, fh, err := c.Request.FormFile(name)
if err != nil {
return nil, err
}
f.Close()
return fh, err
}