diff options
author | George Hazan <george.hazan@gmail.com> | 2014-09-12 14:45:54 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-09-12 14:45:54 +0000 |
commit | 124c695427c4999bd6a4ec97735b6fcac8975474 (patch) | |
tree | bcc26f36e11c4a3729c1947e4c17842bb480c30e /protocols/VKontakte | |
parent | 8a59532193f8be2b54852fcfd828963b13877f9b (diff) |
a couple of memleaks in json parser
git-svn-id: http://svn.miranda-ng.org/main/trunk@10439 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r-- | protocols/VKontakte/src/vk_chats.cpp | 4 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index e24e4023b1..6c4f9e7fc8 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -133,7 +133,7 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe cc->m_admin_id = json_as_int(json_get(info, "admin_id"));
}
- JSONNODE *users = json_as_array(json_get(pResponse, "users"));
+ JSONNODE *users = json_get(pResponse, "users");
if (users != NULL) {
for (int i = 0; i < cc->m_users.getCount(); i++)
cc->m_users[i].m_bDel = true;
@@ -194,7 +194,7 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe JSONNODE *msgs = json_get(pResponse, "msgs");
if (msgs != NULL) {
int numMessages = json_as_int(json_get(msgs, "count"));
- msgs = json_as_array(json_get(msgs, "items"));
+ msgs = json_get(msgs, "items");
if (msgs != NULL){
for (int i = 0; i < numMessages; i++) {
JSONNODE *pMsg = json_at(msgs, i);
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 05494e53f7..4e534ec2e9 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -423,9 +423,11 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq setTString(hContact, "Phone", szValue);
szValue = json_as_string(json_get(pInfo, "status"));
- if (szValue && *szValue)
- if (_tcscmp(db_get_tsa(hContact, "CList", "StatusMsg"), szValue))
+ if (szValue && *szValue) {
+ ptrT tszOldStatus(db_get_tsa(hContact, "CList", "StatusMsg"));
+ if (_tcscmp(tszOldStatus, szValue))
db_set_ts(hContact, "CList", "StatusMsg", szValue);
+ }
szValue = json_as_string(json_get(pInfo, "about"));
if (szValue && *szValue)
|