Skip to content

Commit

Permalink
[FIX] c.Request.FormFile maybe file, need close (gin-gonic#2114)
Browse files Browse the repository at this point in the history
  • Loading branch information
linfangrong authored and ThomasObenaus committed Feb 19, 2020
1 parent bfbb4ba commit 6137b56
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion context.go
Original file line number Diff line number Diff line change
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 6137b56

Please sign in to comment.