diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-11-27 19:07:09 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-11-27 19:07:09 +0000 |
commit | 9c2117c10e0d9eb7eb5b704c0177ee1553d3f198 (patch) | |
tree | 480813616b1fecf62a3690ff6c7ed7c49991d87a /protocols/VKontakte/src/vk_thread.cpp | |
parent | 5cd55bf98d402791990db77399eb9be54f70ddbd (diff) |
VKontakte:
fix memory leaks
fix db_unset on OnJoinChat
code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@11121 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 48e475e135..7e1ef02f0d 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -854,11 +854,16 @@ int CVkProto::PollServer() debugLogA("CVkProto::PollServer (online)");
int iPollConnRetry = MAX_RETRIES;
NETLIBHTTPREQUEST *reply;
+ char *szUrl = NULL;
do {
NETLIBHTTPREQUEST req = { sizeof(req) };
req.requestType = REQUEST_GET;
- req.szUrl = NEWSTR_ALLOCA(CMStringA().Format("http://%s?act=a_check&key=%s&ts=%s&wait=25&access_token=%s&mode=%d", m_pollingServer, m_pollingKey, m_pollingTs, m_szAccessToken, 106));
+ mir_free(szUrl);
+ CMStringA szReqUrl;
+ szReqUrl.AppendFormat("http://%s?act=a_check&key=%s&ts=%s&wait=25&access_token=%s&mode=%d", m_pollingServer, m_pollingKey, m_pollingTs, m_szAccessToken, 106);
// see mode parametr description on https://vk.com/dev/using_longpoll (Russian version)
+ szUrl = mir_strdup(szReqUrl.GetBuffer());
+ req.szUrl = szUrl;
req.flags = VK_NODUMPHEADERS | NLHRF_PERSISTENT;
req.timeout = 30000;
req.nlc = m_pollingConn;
@@ -880,6 +885,7 @@ int CVkProto::PollServer() }
} while (true);
+ mir_free(szUrl);
int retVal = 0;
if (reply->resultCode == 200) {
|