Skip to content

Commit

Permalink
content/local: Close the file if Seek fails
Browse files Browse the repository at this point in the history
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
  • Loading branch information
wzshiming committed Nov 23, 2021
1 parent 51e6040 commit 9dfbcbb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions content/local/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down

0 comments on commit 9dfbcbb

Please sign in to comment.