Skip to content

Commit 754b449

Browse files
WhileLoopvishr
authored andcommitted
Close file descriptor returned by request.FormFile (#1411)
1 parent ee6618e commit 754b449

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

context.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ func (c *context) FormParams() (url.Values, error) {
347347
}
348348

349349
func (c *context) FormFile(name string) (*multipart.FileHeader, error) {
350-
_, fh, err := c.request.FormFile(name)
350+
f, fh, err := c.request.FormFile(name)
351+
defer f.Close()
351352
return fh, err
352353
}
353354

0 commit comments

Comments
 (0)