fix: close backup file (#419)

This commit is contained in:
guangwu 2024-05-16 15:35:28 +08:00 committed by GitHub
parent 9b5ba8958d
commit 4cb47a4818
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,7 @@ func (s *script) encryptArchive() error {
if err != nil {
return errwrap.Wrap(err, fmt.Sprintf("error opening backup file `%s`", s.file))
}
defer src.Close()
if _, err := io.Copy(dst, src); err != nil {
return errwrap.Wrap(err, "error writing ciphertext to file")