content/local: Close the file if Seek fails

Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
This commit is contained in:
Shiming Zhang 2021-11-23 16:17:58 +08:00
parent 51e60404ae
commit 9dfbcbbc48

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")
}