registry/storage: close filereader after allocation
Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
00f02b5fbc
commit
854fa0a4dd
2 changed files with 2 additions and 0 deletions
|
@ -227,6 +227,7 @@ func (bw *blobWriter) validateBlob(ctx context.Context, desc distribution.Descri
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return distribution.Descriptor{}, err
|
return distribution.Descriptor{}, err
|
||||||
}
|
}
|
||||||
|
defer fr.Close()
|
||||||
|
|
||||||
tr := io.TeeReader(fr, digester.Hash())
|
tr := io.TeeReader(fr, digester.Hash())
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,7 @@ func (bw *blobWriter) resumeDigestAt(ctx context.Context, offset int64) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer fr.Close()
|
||||||
|
|
||||||
if _, err = fr.Seek(int64(h.Len()), os.SEEK_SET); err != nil {
|
if _, err = fr.Seek(int64(h.Len()), os.SEEK_SET); err != nil {
|
||||||
return fmt.Errorf("unable to seek to layer reader offset %d: %s", h.Len(), err)
|
return fmt.Errorf("unable to seek to layer reader offset %d: %s", h.Len(), err)
|
||||||
|
|
Loading…
Reference in a new issue