mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
prevent double free
This commit is contained in:
@@ -205,12 +205,12 @@ namespace datagram
|
||||
if(lease)
|
||||
{
|
||||
if(tunnel)
|
||||
return DatagramSession::Info{new i2p::data::IdentHash(lease->tunnelGateway.data()), new i2p::data::IdentHash(tunnel->GetEndpointIdentHash().data()), m_LastUse, m_LastSuccess};
|
||||
return DatagramSession::Info{lease->tunnelGateway, tunnel->GetEndpointIdentHash(), m_LastUse, m_LastSuccess};
|
||||
else
|
||||
return DatagramSession::Info{new i2p::data::IdentHash(lease->tunnelGateway.data()), nullptr, m_LastUse, m_LastSuccess};
|
||||
return DatagramSession::Info{lease->tunnelGateway, nullptr, m_LastUse, m_LastSuccess};
|
||||
}
|
||||
else if(tunnel)
|
||||
return DatagramSession::Info{nullptr, new i2p::data::IdentHash(tunnel->GetEndpointIdentHash().data()), m_LastUse, m_LastSuccess};
|
||||
return DatagramSession::Info{nullptr, tunnel->GetEndpointIdentHash(), m_LastUse, m_LastSuccess};
|
||||
else
|
||||
return DatagramSession::Info{nullptr, nullptr, m_LastUse, m_LastSuccess};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user