From f4a41df7b0b39972ebff39377363718d49201159 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 13 May 2016 18:44:47 +0000 Subject: two memory leaks fixed in SkypeWeb git-svn-id: http://svn.miranda-ng.org/main/trunk@16826 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_chatrooms.cpp | 3 +-- protocols/SkypeWeb/src/skype_polling.cpp | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 4c7353cae0..e7a47cf2d6 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -468,7 +468,7 @@ void CSkypeProto::AddMessageToChat(const TCHAR *chat_id, const TCHAR *from, cons void CSkypeProto::OnGetChatInfo(const NETLIBHTTPREQUEST *response, void *p) { - TCHAR *topic = (TCHAR*)p; + ptrT topic((TCHAR*)p); // memory must be freed in any case if (response == NULL || response->pData == NULL) return; @@ -493,7 +493,6 @@ void CSkypeProto::OnGetChatInfo(const NETLIBHTTPREQUEST *response, void *p) AddChatContact(_A2T(chatId), username, username, _A2T(role.c_str()), true); } PushRequest(new GetHistoryRequest(chatId, 15, true, 0, li), &CSkypeProto::OnGetServerHistory); - mir_free(topic); } void CSkypeProto::RenameChat(const char *chat_id, const char *name) diff --git a/protocols/SkypeWeb/src/skype_polling.cpp b/protocols/SkypeWeb/src/skype_polling.cpp index 31de0c75c1..9de9e4108d 100644 --- a/protocols/SkypeWeb/src/skype_polling.cpp +++ b/protocols/SkypeWeb/src/skype_polling.cpp @@ -94,7 +94,9 @@ void CSkypeProto::ParsePollData(void *pData) { debugLogA(__FUNCTION__); - JSONNode data = JSONNode::parse((char*)pData); + ptrA szData((char*)pData); // memory must be freed in any case + + JSONNode data = JSONNode::parse(szData); if (!data) return; const JSONNode &node = data["eventMessages"]; @@ -128,7 +130,6 @@ void CSkypeProto::ParsePollData(void *pData) ProcessThreadUpdate(resource); } } - mir_free(pData); } void CSkypeProto::ProcessEndpointPresence(const JSONNode &node) -- cgit v1.2.3