X Tutup
Skip to content

Commit 9dfbcbb

Browse files
committed
content/local: Close the file if Seek fails
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
1 parent 51e6040 commit 9dfbcbb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

content/local/store.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ func (s *store) writer(ctx context.Context, ref string, total int64, expected di
592592
}
593593

594594
if _, err := fp.Seek(offset, io.SeekStart); err != nil {
595+
fp.Close()
595596
return nil, errors.Wrap(err, "could not seek to current write offset")
596597
}
597598

0 commit comments

Comments
 (0)
X Tutup