[reSIProcate-users] Memory leak
Hi.
May be somebody has found it already, or may be i'm mistaken, but it seems that i've found memory leak in reTurn.
See file ChannelManager.cxx, there are two functions: findRemotePeerByChannel and findRemotePeerByPeerAddress.
They have same bug:
ChannelManager::findRemotePeerByChannel(unsigned short channelNumber)
{
// search for element in collect
ChannelRemotePeerMap::iterator it = mChannelRemotePeerMap.find(channelNumber);
if(it != mChannelRemotePeerMap.end())
{
if(!it->second->isExpired())
{
// everything is ok - return it.
return it->second;
}
else
{
// else remove element from collectins
mTupleRemotePeerMap.erase(it->second->getPeerTuple());
mChannelRemotePeerMap.erase(it);
// ooops, we forgot to delete element it->second.
}
}
return 0;
}