mirror of
https://github.com/restic/restic.git
synced 2025-08-23 13:08:08 +00:00
Merge pull request #1583 from restic/close-open-backend-files
Close backend files in case of errors
This commit is contained in:
@@ -40,6 +40,7 @@ func Repack(ctx context.Context, repo restic.Repository, packs restic.IDSet, kee
|
||||
hrd := hashing.NewReader(beRd, sha256.New())
|
||||
packLength, err := io.Copy(tempfile, hrd)
|
||||
if err != nil {
|
||||
_ = beRd.Close()
|
||||
return nil, errors.Wrap(err, "Copy")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user