diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-18 11:14:19 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-18 11:14:19 +0000 |
commit | ce2529939b498acc2be8c3c09c897c6f96eee9f7 (patch) | |
tree | bc1466ac0eae8ad48758fb060349db9610b342c2 /protocols/SkypeWeb/src/skype_polling.cpp | |
parent | e934e6f00db72324d80ff0c272249435d884cc64 (diff) |
SkypeWeb: more fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@14982 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_polling.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_polling.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
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)
|