Fixed some memory leaks in RsGxsNetService.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6534 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-07-23 12:17:50 +00:00
parent a2ab72fed3
commit 6dc9dcd49d

View File

@ -553,7 +553,6 @@ void RsGxsNetService::recvNxsItemQueue(){
RsNxsItem *ni = dynamic_cast<RsNxsItem*>(item) ; RsNxsItem *ni = dynamic_cast<RsNxsItem*>(item) ;
if(ni != NULL) if(ni != NULL)
{ {
// a live transaction has a non zero value // a live transaction has a non zero value
if(ni->transactionNumber != 0){ if(ni->transactionNumber != 0){
@ -576,6 +575,11 @@ void RsGxsNetService::recvNxsItemQueue(){
} }
delete item ; delete item ;
} }
else
{
std::cerr << "Not a RsNxsItem, deleting!" << std::endl;
delete(item);
}
} }
} }
@ -1881,6 +1885,7 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsg* item)
if(req.empty()) if(req.empty())
{ {
delete(grpMeta);
return; return;
} }
@ -1905,7 +1910,6 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsg* item)
mItem->PeerId(peer); mItem->PeerId(peer);
mItem->transactionNumber = transN; mItem->transactionNumber = transN;
itemL.push_back(mItem); itemL.push_back(mItem);
} }
if(!itemL.empty()) if(!itemL.empty())
@ -1917,7 +1921,7 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsg* item)
for(vit = msgMetas.begin(); vit != msgMetas.end(); vit++) for(vit = msgMetas.begin(); vit != msgMetas.end(); vit++)
delete *vit; delete *vit;
return; delete(grpMeta);
} }
void RsGxsNetService::locked_pushMsgRespFromList(std::list<RsNxsItem*>& itemL, const std::string& sslId, void RsGxsNetService::locked_pushMsgRespFromList(std::list<RsNxsItem*>& itemL, const std::string& sslId,