replay: fix segfault caused by pointer usage after freeing (#28779)

old-commit-hash: aa85fed91d1d2861ca65c9c44f2865127c0fa8a3
This commit is contained in:
Qi Liu
2023-07-01 23:01:47 -07:00
committed by GitHub
parent 036603682f
commit 5c6e533bf4

View File

@@ -74,8 +74,8 @@ bool LogReader::parse(const std::set<cereal::Event::Which> &allow, std::atomic<b
Event *evt = new Event(words);
#endif
if (!allow.empty() && allow.find(evt->which) == allow.end()) {
delete evt;
words = kj::arrayPtr(evt->reader.getEnd(), words.end());
delete evt;
continue;
}