[Coverity] Dereference before null check (REVERSE_INULL)
This commit is contained in:
@@ -278,7 +278,7 @@ TestCase::CreateDataDirFilename (std::string filename)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << filename);
|
||||
const TestCase *current = this;
|
||||
while (current->m_dataDir == "" && current != 0)
|
||||
while (current != 0 && current->m_dataDir == "")
|
||||
{
|
||||
current = current->m_parent;
|
||||
}
|
||||
|
||||
@@ -2104,7 +2104,7 @@ RoutingProtocol::LinkSensing (const olsr::MessageHeader &msg,
|
||||
}
|
||||
|
||||
// Schedules link tuple deletion
|
||||
if (created && link_tuple != NULL)
|
||||
if (created)
|
||||
{
|
||||
LinkTupleAdded (*link_tuple, hello.willingness);
|
||||
m_events.Track (Simulator::Schedule (DELAY (std::min (link_tuple->time, link_tuple->symTime)),
|
||||
|
||||
@@ -940,9 +940,9 @@ ProtocolTlvValue::ProtocolTlvValue ()
|
||||
}
|
||||
ProtocolTlvValue::~ProtocolTlvValue ()
|
||||
{
|
||||
m_protocol->clear ();
|
||||
if (m_protocol != 0)
|
||||
{
|
||||
m_protocol->clear ();
|
||||
delete m_protocol;
|
||||
m_protocol = 0;
|
||||
}
|
||||
@@ -1013,9 +1013,9 @@ Ipv4AddressTlvValue::Ipv4AddressTlvValue ()
|
||||
|
||||
Ipv4AddressTlvValue::~Ipv4AddressTlvValue ()
|
||||
{
|
||||
m_ipv4Addr->clear ();
|
||||
if (m_ipv4Addr != 0)
|
||||
{
|
||||
m_ipv4Addr->clear ();
|
||||
delete m_ipv4Addr;
|
||||
m_ipv4Addr = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user