From 18f9da02865294f8d34527e290ad85697dfceb3b Mon Sep 17 00:00:00 2001 From: honghaiz Date: Wed, 1 Jun 2016 23:53:01 -0700 Subject: [PATCH] Fix a memory issue when calling LOG_J in port.cc The connection delete message may be processed when a port is being deleted. Calling LOG_J here needs to access the port object that may have been partially released. This fixes the memcheck bot failure. TBR=pthatcher@webrtc.org BUG= Review-Url: https://codereview.webrtc.org/2026403003 Cr-Commit-Position: refs/heads/master@{#13002} --- webrtc/p2p/base/port.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc index 9fa6bad911..909843c62f 100644 --- a/webrtc/p2p/base/port.cc +++ b/webrtc/p2p/base/port.cc @@ -1404,8 +1404,8 @@ void Connection::MaybeUpdatePeerReflexiveCandidate( void Connection::OnMessage(rtc::Message *pmsg) { ASSERT(pmsg->message_id == MSG_DELETE); - LOG_J(LS_INFO, this) << "Connection deleted with number of pings sent: " - << num_pings_sent_; + LOG(LS_INFO) << "Connection deleted with number of pings sent: " + << num_pings_sent_; SignalDestroyed(this); delete this; }