fixed memory leak in p3GxsTunnel

This commit is contained in:
csoler 2018-02-26 23:37:19 +01:00
parent dd9f67a28b
commit aad9397ef8
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C

View file

@ -143,7 +143,10 @@ void p3GxsTunnelService::flush()
for(std::list<RsGxsTunnelDHPublicKeyItem*>::iterator it=pendingDHItems.begin();it!=pendingDHItems.end();) for(std::list<RsGxsTunnelDHPublicKeyItem*>::iterator it=pendingDHItems.begin();it!=pendingDHItems.end();)
if(locked_sendClearTunnelData(*it) ) if(locked_sendClearTunnelData(*it) )
{
delete *it ;
it = pendingDHItems.erase(it) ; it = pendingDHItems.erase(it) ;
}
else else
++it ; ++it ;
} }
@ -155,7 +158,10 @@ void p3GxsTunnelService::flush()
for(std::list<RsGxsTunnelItem*>::iterator it=pendingGxsTunnelItems.begin();it!=pendingGxsTunnelItems.end();) for(std::list<RsGxsTunnelItem*>::iterator it=pendingGxsTunnelItems.begin();it!=pendingGxsTunnelItems.end();)
if(locked_sendEncryptedTunnelData(*it) ) if(locked_sendEncryptedTunnelData(*it) )
{
delete *it ;
it = pendingGxsTunnelItems.erase(it) ; it = pendingGxsTunnelItems.erase(it) ;
}
else else
{ {
++it ; ++it ;
@ -744,6 +750,8 @@ void p3GxsTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *gitem,cons
} }
else else
std::cerr << "(EE) Deserialiased item has unexpected type." << std::endl; std::cerr << "(EE) Deserialiased item has unexpected type." << std::endl;
delete citem ;
} }
} }