Merge pull request #1149 from stevvooe/close-filereader

registry/storage: close filereader after allocation
This commit is contained in:
Richard Scothern 2015-11-02 13:22:32 -08:00
commit 222e6e91c4
2 changed files with 2 additions and 0 deletions

View file

@ -227,6 +227,7 @@ func (bw *blobWriter) validateBlob(ctx context.Context, desc distribution.Descri
if err != nil {
return distribution.Descriptor{}, err
}
defer fr.Close()
tr := io.TeeReader(fr, digester.Hash())

View file

@ -91,6 +91,7 @@ func (bw *blobWriter) resumeDigestAt(ctx context.Context, offset int64) error {
if err != nil {
return err
}
defer fr.Close()
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)