mirror of
https://github.com/astaxie/beego.git
synced 2024-12-22 16:10:50 +00:00
leak opened file
should defer file.Close()
This commit is contained in:
parent
11774c87a5
commit
5a5482c77f
@ -175,6 +175,7 @@ func (e *Email) AttachFile(args ...string) (a *Attachment, err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer f.Close()
|
||||
ct := mime.TypeByExtension(filepath.Ext(filename))
|
||||
basename := path.Base(filename)
|
||||
return e.Attach(f, basename, ct, id)
|
||||
|
Loading…
Reference in New Issue
Block a user