From c187c03758c14d189467fe1eaf80131cf4fc817f Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 14 Jun 2015 21:24:17 +0000 Subject: [PATCH] Fixed memory leak in DistributedChatService::invitePeerToLobby when lobby not found. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8452 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/chat/distributedchat.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/chat/distributedchat.cc b/libretroshare/src/chat/distributedchat.cc index 72ce1f63a..a85aa6220 100644 --- a/libretroshare/src/chat/distributedchat.cc +++ b/libretroshare/src/chat/distributedchat.cc @@ -1168,8 +1168,6 @@ void DistributedChatService::invitePeerToLobby(const ChatLobbyId& lobby_id, cons std::cerr << "Sending invitation to peer " << peer_id << " to lobby "<< std::hex << lobby_id << std::dec << std::endl; #endif - RsChatLobbyInviteItem *item = new RsChatLobbyInviteItem ; - RsStackMutex stack(mDistributedChatMtx); /********** STACK LOCKED MTX ******/ std::map::iterator it = _chat_lobbys.find(lobby_id) ; @@ -1181,6 +1179,9 @@ void DistributedChatService::invitePeerToLobby(const ChatLobbyId& lobby_id, cons #endif return ; } + + RsChatLobbyInviteItem *item = new RsChatLobbyInviteItem ; + item->lobby_id = lobby_id ; item->lobby_name = it->second.lobby_name ; item->lobby_topic = it->second.lobby_topic ;