1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-23 08:16:36 +00:00

backend.LoadAll: Check errors from io.Copy()

This commit is contained in:
Alexander Neumann 2017-05-01 15:38:01 +02:00
parent 63870d2830
commit b84e63d503

View file

@ -14,8 +14,12 @@ func LoadAll(be restic.Backend, h restic.Handle) (buf []byte, err error) {
}
defer func() {
io.Copy(ioutil.Discard, rd)
e := rd.Close()
_, e := io.Copy(ioutil.Discard, rd)
if err == nil {
err = e
}
e = rd.Close()
if err == nil {
err = e
}