1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-28 01:44:14 +00:00

fixed memory leak

This commit is contained in:
orignal 2014-07-15 08:03:45 -04:00
parent 999abd517c
commit 05a96fd398

View File

@ -126,7 +126,9 @@ namespace ssu
}
else
break;
}
}
if (isLast)
LogPrint ("Message ", msgID, " complete");
}
}
else
@ -138,7 +140,12 @@ namespace ssu
{
// missing fragment
LogPrint ("Missing fragments from ", (int)incompleteMessage->nextFragmentNum, " to ", fragmentNum - 1, " of message ", msgID);
incompleteMessage->savedFragments.insert (new Fragment (fragmentNum, buf, fragmentSize, isLast));
auto savedFragment = new Fragment (fragmentNum, buf, fragmentSize, isLast);
if (!incompleteMessage->savedFragments.insert (savedFragment).second)
{
LogPrint ("Fragment ", (int)fragmentNum, " of message ", msgID, " already saved");
delete savedFragment;
}
}
isLast = false;
}