mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-18 23:36:39 +01:00
fixed memory leak
This commit is contained in:
parent
b11fd250c1
commit
93c2c13f96
1 changed files with 15 additions and 7 deletions
|
@ -515,6 +515,7 @@ namespace data
|
||||||
auto floodfill = GetClosestFloodfill (buf + DATABASE_STORE_KEY_OFFSET, excluded);
|
auto floodfill = GetClosestFloodfill (buf + DATABASE_STORE_KEY_OFFSET, excluded);
|
||||||
if (floodfill)
|
if (floodfill)
|
||||||
{
|
{
|
||||||
|
excluded.insert (floodfill->GetIdentHash ());
|
||||||
auto floodMsg = NewI2NPShortMessage ();
|
auto floodMsg = NewI2NPShortMessage ();
|
||||||
uint8_t * payload = floodMsg->GetPayload ();
|
uint8_t * payload = floodMsg->GetPayload ();
|
||||||
memcpy (payload, buf, 33); // key + type
|
memcpy (payload, buf, 33); // key + type
|
||||||
|
@ -544,6 +545,8 @@ namespace data
|
||||||
i2p::DeleteI2NPMessage (m);
|
i2p::DeleteI2NPMessage (m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
CryptoPP::Gunzip decompressor;
|
CryptoPP::Gunzip decompressor;
|
||||||
decompressor.Put (buf + offset, size);
|
decompressor.Put (buf + offset, size);
|
||||||
decompressor.MessageEnd();
|
decompressor.MessageEnd();
|
||||||
|
@ -552,6 +555,11 @@ namespace data
|
||||||
decompressor.Get (uncompressed, uncomressedSize);
|
decompressor.Get (uncompressed, uncomressedSize);
|
||||||
AddRouterInfo (buf + DATABASE_STORE_KEY_OFFSET, uncompressed, uncomressedSize);
|
AddRouterInfo (buf + DATABASE_STORE_KEY_OFFSET, uncompressed, uncomressedSize);
|
||||||
}
|
}
|
||||||
|
catch (CryptoPP::Exception& ex)
|
||||||
|
{
|
||||||
|
LogPrint (eLogError, "DatabaseStore: ", ex.what ());
|
||||||
|
}
|
||||||
|
}
|
||||||
i2p::DeleteI2NPMessage (m);
|
i2p::DeleteI2NPMessage (m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue