Skip to content

Commit 5fcc3bb

Browse files
fix use after free in index_lock (#546)
Signed-off-by: Alexey Chernyshov <[email protected]>
1 parent e59a5b3 commit 5fcc3bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/sector_storage/stores/impl/index_lock.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ namespace fc::sector_storage::stores {
6666
}
6767
sector.write = static_cast<SectorFileType>(sector.write & ~lock.write);
6868
--sector.refs;
69+
sector.cv.notify_all();
70+
sector_lock.unlock();
6971
if (!sector.refs) {
7072
sectors.erase(lock.sector);
7173
}
72-
sector.cv.notify_all();
7374
}
7475
} // namespace fc::sector_storage::stores

0 commit comments

Comments
 (0)