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

pull/28792/head
Qi Liu 2 years ago committed by GitHub
parent 6495a18cc9
commit aa85fed91d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      tools/replay/logreader.cc

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

Loading…
Cancel
Save