Hi,
The removeDestinationFromList() function is broken (Increment on an
undefined iterator) after destList.erase(i).
I send a correction that does increment before iterator i becomes invalid.
With this the problem is solved.



bool
DestinationListHandler::removeDestinationFromList(const InetAddress& ia,
                                                  tpport_t dataPort,
                                                  tpport_t controlPort)
{
        bool result = false;
        writeLockDestinationList();
        TransportAddress* tmp;

        std::list<TransportAddress*>::iterator i;

        for ( i = destList.begin(); destList.end() != i && !result;)
<-------------
        {
                tmp = *i;
                if ( ia == tmp->getNetworkAddress() &&
                     dataPort == tmp->getDataTransportPort() &&
                     controlPort == tmp->getControlTransportPort() ) 
                {
                        // matches. -> remove it.
                        result = true;
                        destList.erase(i++);          <-------------
                        delete tmp;
                }
                else
                {
                        i++;     <-------------
                }
        }
        unlockDestinationList();
        return result;
}


With best regards

Martin Mainka 



_______________________________________________
Ccrtp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/ccrtp-devel

Reply via email to