Fixed memory leak in RsGenExchange::publishMsgs.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8457 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2015-06-14 23:04:54 +00:00
parent 5af0716a16
commit 8cc2c921ed

View File

@ -1820,12 +1820,9 @@ void RsGenExchange::publishMsgs()
std::cerr << std::endl;
#endif
RsNxsMsg* msg = new RsNxsMsg(mServType);
RsGxsMsgItem* msgItem = mit->second;
const uint32_t& token = mit->first;
msg->grpId = msgItem->meta.mGroupId;
uint32_t size = mSerialiser->size(msgItem);
char* mData = new char[size];
@ -1841,6 +1838,9 @@ void RsGenExchange::publishMsgs()
if(serialOk)
{
RsNxsMsg* msg = new RsNxsMsg(mServType);
msg->grpId = msgItem->meta.mGroupId;
msg->msg.setBinData(mData, size);
// now create meta