From 9dfbcbbc481076a8ae8d81c654ff452334e049fb Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Tue, 23 Nov 2021 16:17:58 +0800 Subject: [PATCH] content/local: Close the file if Seek fails Signed-off-by: Shiming Zhang --- content/local/store.go | 1 + 1 file changed, 1 insertion(+) diff --git a/content/local/store.go b/content/local/store.go index b4a388bad..c105f926e 100644 --- a/content/local/store.go +++ b/content/local/store.go @@ -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") }