defer close piecestore in downloadAndVerifyPiece (#3192)

This commit is contained in:
Cameron 2019-10-06 13:41:53 -04:00 committed by GitHub
parent c1fbfea7fa
commit eb5413ae5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,6 +167,7 @@ func (ec *ECRepairer) downloadAndVerifyPiece(ctx context.Context, limit *pb.Addr
if err != nil {
return nil, err
}
defer func() { err = errs.Combine(err, ps.Close()) }()
downloader, err := ps.Download(ctx, limit.GetLimit(), privateKey, 0, pieceSize)
if err != nil {