Skip to content

Commit

Permalink
fix(#45): close fd after creating qrcode file
Browse files Browse the repository at this point in the history
  • Loading branch information
yeung66 authored Nov 6, 2021
1 parent d26d3ac commit ec03957
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qrcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,8 @@ func (q *QRCode) Save(saveToPath string) (err error) {
return fmt.Errorf("save failed, err=%v", err)
}

defer fd.Close()

return q.SaveTo(fd)

//q.Draw()
Expand Down

0 comments on commit ec03957

Please sign in to comment.