diff --git a/common/ledger/blkstorage/blockfile_mgr.go b/common/ledger/blkstorage/blockfile_mgr.go index bb14d3f7d40..6a4bb377c16 100644 --- a/common/ledger/blkstorage/blockfile_mgr.go +++ b/common/ledger/blkstorage/blockfile_mgr.go @@ -426,6 +426,7 @@ func (mgr *blockfileMgr) syncIndex() error { if stream, err = newBlockStream(mgr.rootDir, startFileNum, int64(startOffset), endFileNum); err != nil { return err } + defer stream.close() var blockBytes []byte var blockPlacementInfo *blockPlacementInfo