Merge pull request #6280 from wzshiming/fix/close-with-seek-fail

content/local: Close the file if Seek fails
This commit is contained in:
Maksym Pavlenko 2021-11-23 12:38:17 -08:00 committed by GitHub
commit cf6f19cea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -592,6 +592,7 @@ func (s *store) writer(ctx context.Context, ref string, total int64, expected di
}
if _, err := fp.Seek(offset, io.SeekStart); err != nil {
fp.Close()
return nil, errors.Wrap(err, "could not seek to current write offset")
}