storagenode/pieces: close reader after use

Change-Id: Icd9df821edb668c5521732396b7d6be3b8e75c7a
This commit is contained in:
Andrew Harding 2023-03-13 07:15:32 -06:00 committed by Egon Elbre
parent 0b66d22be4
commit 5c744d7ed4

View File

@ -798,6 +798,10 @@ func (access storedPieceAccess) CreationTime(ctx context.Context) (cTime time.Ti
if err != nil {
return time.Time{}, err
}
defer func() {
err = errs.Combine(err, reader.Close())
}()
header, err := reader.GetPieceHeader()
if err != nil {
return time.Time{}, err