diff options
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)
|