Skip to content

Commit

Permalink
[FIX] c.Request.FormFile maybe file, need close (#2114)
Browse files Browse the repository at this point in the history
  • Loading branch information
linfangrong authored and thinkerou committed Oct 31, 2019
1 parent aabaccb commit 0f95195
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion context.go
Expand Up @@ -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
}

Expand Down

0 comments on commit 0f95195

Please sign in to comment.