Skip to content

Commit

Permalink
Node: fixed crash when deleting PeerInfo that's still in use
Browse files Browse the repository at this point in the history
  • Loading branch information
valdok committed Jan 3, 2019
1 parent 202b111 commit d9d1205
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,11 @@ void Node::Peer::OnMsg(proto::Authentication&& msg)

if (!pPi->m_pLive->IsSecureOut() || (m_This.m_MyPublicID > msg.m_ID))
{
// detach from that peer
assert(pPi == pPi->m_pLive->m_pInfo);
pPi->m_pLive->m_pInfo = nullptr;
pPi->m_pLive = nullptr;

pPi->m_pLive->DeleteSelf(false, ByeReason::Duplicate);
assert(!pPi->m_pLive);
}
Expand Down

0 comments on commit d9d1205

Please sign in to comment.