Skip to content

Commit

Permalink
fix: close files
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored Apr 12, 2024
1 parent d8bf889 commit 99606ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion process.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ func (p *Processor) Process(r io.Reader, w io.Writer) error {
if err != nil {
return fmt.Errorf("could not open the mask file: %v", err)
}

defer mf.Close()

ctype, err := utils.DetectContentType(mf.Name())
if err != nil {
return err
Expand All @@ -527,6 +528,7 @@ func (p *Processor) Process(r io.Reader, w io.Writer) error {
if err != nil {
return fmt.Errorf("could not open the mask file: %v", err)
}
defer rmf.Close()

ctype, err := utils.DetectContentType(rmf.Name())
if err != nil {
Expand Down

0 comments on commit 99606ae

Please sign in to comment.