diff --git a/P25Control.cpp b/P25Control.cpp index 22e200a..a424ee4 100644 --- a/P25Control.cpp +++ b/P25Control.cpp @@ -595,6 +595,10 @@ unsigned int CP25Control::readModem(unsigned char* data) void CP25Control::writeNetwork() { unsigned char data[100U]; + + if (m_network == NULL) + return; + unsigned int length = m_network->read(data, 100U); if (length == 0U) return; diff --git a/P25NID.cpp b/P25NID.cpp index 20d8f91..5e057c5 100644 --- a/P25NID.cpp +++ b/P25NID.cpp @@ -98,7 +98,6 @@ CP25NID::~CP25NID() delete[] m_term; delete[] m_tsdu; delete[] m_pdu; - delete[] m_tsdu; } bool CP25NID::decode(const unsigned char* data) diff --git a/POCSAGControl.cpp b/POCSAGControl.cpp index 48e4578..498a0a7 100644 --- a/POCSAGControl.cpp +++ b/POCSAGControl.cpp @@ -97,7 +97,8 @@ unsigned int CPOCSAGControl::readModem(unsigned char* data) bool CPOCSAGControl::processData() { - assert(m_network != NULL); + if (m_network == NULL) + return false; unsigned char data[300U]; unsigned int length = m_network->read(data);