< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate-users] Memory leak


Nice catch - I have committed a fix - thanks.

Scott

On Fri, Jan 28, 2011 at 7:14 PM, Khnykin Evgeniy <hsilgos@xxxxxxxxx> wrote:
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;
}

_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/