diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-01-21 04:48:55 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-01-21 04:48:55 +0000 |
commit | 4d325effb6ac409e36b04657860e81fb3df760f3 (patch) | |
tree | 49f72194c53f2443d8dbb298e74ddcc6abba66ee /protocols/VKontakte/src/vk_feed.cpp | |
parent | 7d4e48d8de0eb5ed44dc7f11a1f777ea461a2843 (diff) |
VKontakte:
fix potential crash on sent files (detect by coverity)
fix memory leak (detect by coverity)
git-svn-id: http://svn.miranda-ng.org/main/trunk@11885 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_feed.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_feed.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 4744a9e44b..18a8286a16 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -358,12 +358,16 @@ CVKNewsItem* CVkProto::GetVkParent(JSONNODE *pParent, VKObjType vkParentType, TC ClearFormatNick(tszText);
JSONNODE *pNode = json_get(pParent, "photo");
- if (pNode)
+ if (pNode){
+ delete vkNotificationItem;
return GetVkParent(pNode, vkPhoto, tszText.IsEmpty() ? NULL : tszText.GetBuffer());
+ }
pNode = json_get(pParent, "video");
- if (pNode)
+ if (pNode){
+ delete vkNotificationItem;
return GetVkParent(pNode, vkVideo, tszText.IsEmpty() ? NULL : tszText.GetBuffer());
+ }
LONG iId = json_as_int(json_get(pParent, "id"));
@@ -371,6 +375,7 @@ CVKNewsItem* CVkProto::GetVkParent(JSONNODE *pParent, VKObjType vkParentType, TC if (pNode) {
CMString tszRepl;
tszRepl.AppendFormat(_T("?reply=%d"), iId);
+ delete vkNotificationItem;
return GetVkParent(pNode, vkPost, tszText.IsEmpty() ? NULL : tszText.GetBuffer(), tszRepl.GetBuffer());
}
@@ -378,6 +383,7 @@ CVKNewsItem* CVkProto::GetVkParent(JSONNODE *pParent, VKObjType vkParentType, TC if (pNode) {
CMString tszRepl;
tszRepl.AppendFormat(_T("?reply=%d"), iId);
+ delete vkNotificationItem;
return GetVkParent(pNode, vkTopic, tszText.IsEmpty() ? NULL : tszText.GetBuffer(), tszRepl.GetBuffer());
}
}
|