mirror of
https://github.com/ShaYmez/P25Clients.git
synced 2024-12-23 10:25:37 -05:00
Merge pull request #220 from miguelestrada/miguelestrada-delete-correct-rpt
Avoid memory corruption - Delete correct expired or unlinking repeater
This commit is contained in:
commit
91c7f30616
@ -233,8 +233,8 @@ void CP25Reflector::run()
|
||||
|
||||
for (std::vector<CP25Repeater*>::iterator it = m_repeaters.begin(); it != m_repeaters.end(); ++it) {
|
||||
if (CUDPSocket::match((*it)->m_addr, rpt->m_addr)) {
|
||||
m_repeaters.erase(it);
|
||||
delete *it;
|
||||
m_repeaters.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -304,8 +304,8 @@ void CP25Reflector::run()
|
||||
LogMessage("Removing %s (%s) disappeared", (*it)->m_callsign.c_str(),
|
||||
CUDPSocket::display((*it)->m_addr, buff, 80U));
|
||||
|
||||
m_repeaters.erase(it);
|
||||
delete *it;
|
||||
m_repeaters.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user