From ce2529939b498acc2be8c3c09c897c6f96eee9f7 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Tue, 18 Aug 2015 11:14:19 +0000 Subject: SkypeWeb: more fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@14982 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_polling.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_polling.cpp') diff --git a/protocols/SkypeWeb/src/skype_polling.cpp b/protocols/SkypeWeb/src/skype_polling.cpp index f5db4e8140..00e5555ef8 100644 --- a/protocols/SkypeWeb/src/skype_polling.cpp +++ b/protocols/SkypeWeb/src/skype_polling.cpp @@ -41,8 +41,16 @@ void CSkypeProto::PollingThread(void*) if (response->pData) { void *pData = mir_alloc(response->dataLength); - memcpy(pData, response->pData, response->dataLength); - ForkThread(&CSkypeProto::ParsePollData, pData); + if (pData != NULL) + { + memcpy(pData, response->pData, response->dataLength); + ForkThread(&CSkypeProto::ParsePollData, pData); + } + else + { + debugLogA(__FUNCTION__ ": memory overflow !!!"); + break; + } } } else @@ -82,7 +90,7 @@ void CSkypeProto::ParsePollData(void *pData) { debugLogA(__FUNCTION__); - JSONNode data = JSONNode::parse(ptrA((char*)pData)); + JSONNode data = JSONNode::parse((char*)pData); if (!data) return; const JSONNode &node = data["eventMessages"]; @@ -116,6 +124,7 @@ void CSkypeProto::ParsePollData(void *pData) ProcessThreadUpdate(resource); } } + mir_free(pData); } void CSkypeProto::ProcessEndpointPresence(const JSONNode &node) -- cgit v1.2.3