diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-13 19:35:57 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-13 19:35:57 +0000 |
commit | ce0d35aaa003e891027bbece4339107eb9e146ed (patch) | |
tree | e1db3fd4f72a17e0968e7bd6f3cd7de6c68fa9ac /protocols/SkypeWeb/src/skype_events.cpp | |
parent | 432bd3d2f4c35472d1389b187cc572d20819cabf (diff) |
SkypeWeb: memleaks fix.
git-svn-id: http://svn.miranda-ng.org/main/trunk@14553 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_events.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_events.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp index 99dd4a2b5e..64cf955faf 100644 --- a/protocols/SkypeWeb/src/skype_events.cpp +++ b/protocols/SkypeWeb/src/skype_events.cpp @@ -67,14 +67,18 @@ INT_PTR CSkypeProto::GetCallEventText(WPARAM, LPARAM lParam) HXML xmlNode = xmlGetNthChild(xml, _T("file"), i);
if (xmlNode != NULL)
{
- fileSize = _ttoi(xmlGetAttrValue(xmlNode, _T("size")));
+ fileSize = _ttoi(ptrT((TCHAR*)xmlGetAttrValue(xmlNode, _T("size"))));
ptrA fileName(mir_utf8encodeT(xmlGetText(xmlNode)));
- if (fileName == NULL || fileSize == NULL)
- continue;
- CMStringA msg(FORMAT, "%s:\n\t%s: %s\n\t%s: %d %s", Translate("File transfer"), Translate("File name"), fileName, Translate("Size"), fileSize, Translate("bytes"));
- text.AppendFormat("%s\n", msg);
+ if (fileName != NULL)
+ {
+ CMStringA msg(FORMAT, "%s:\n\t%s: %s\n\t%s: %d %s", Translate("File transfer"), Translate("File name"), fileName, Translate("Size"), fileSize, Translate("bytes"));
+ text.AppendFormat("%s\n", msg);
+ }
+
+ xmlDestroyNode(xmlNode);
}
}
+ xmlDestroyNode(xml);
}
pszText = mir_strdup(text.GetBuffer());
break;
@@ -86,6 +90,7 @@ INT_PTR CSkypeProto::GetCallEventText(WPARAM, LPARAM lParam) if (xml != NULL)
{
text.Append(mir_t2a(xmlGetText(xml)));
+ xmlDestroyNode(xml);
}
pszText = mir_strdup(text.GetBuffer());
break;
@@ -108,7 +113,6 @@ INT_PTR CSkypeProto::GetCallEventText(WPARAM, LPARAM lParam) TCHAR *pwszText = _A2T(pszText);
nRetVal = (INT_PTR)mir_tstrdup(pwszText);
}
-
else if (pEvent->datatype == DBVT_ASCIIZ)
nRetVal = (INT_PTR)mir_strdup(pszText);
|