summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-03 18:28:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-03 18:28:20 +0000
commit784c2757e8c791b4c76a6e739f08b0fb92ec093a (patch)
treeba42917a56f96f8b5d6f55edb36d9fc337ca1b39 /protocols/JabberG/src/jabber_proto.cpp
parent9026d578dc4b14aa12c51a2147bb999703efbb36 (diff)
- old junk removed;
- mir_free() doesn't require a check git-svn-id: http://svn.miranda-ng.org/main/trunk@6321 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_proto.cpp')
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp36
1 files changed, 14 insertions, 22 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index bb70bc2ecd..414d1df358 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -214,8 +214,7 @@ CJabberProto::~CJabberProto()
for (i=0; i < m_lstJabberFeatCapPairsDynamic.getCount(); i++) {
mir_free(m_lstJabberFeatCapPairsDynamic[i]->szExt);
mir_free(m_lstJabberFeatCapPairsDynamic[i]->szFeature);
- if (m_lstJabberFeatCapPairsDynamic[i]->szDescription)
- mir_free(m_lstJabberFeatCapPairsDynamic[i]->szDescription);
+ mir_free(m_lstJabberFeatCapPairsDynamic[i]->szDescription);
delete m_lstJabberFeatCapPairsDynamic[i];
}
m_lstJabberFeatCapPairsDynamic.destroy();
@@ -353,7 +352,7 @@ HANDLE CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags)
setTString(hContact, "jid", jid);
if ((nick=JabberNickFromJID(newJid)) == NULL)
nick = mir_tstrdup(newJid);
-// setTString(hContact, "Nick", nick);
+
mir_free(nick);
mir_free(jid);
@@ -487,20 +486,19 @@ int CJabberProto::AuthDeny(HANDLE hDbEvent, const TCHAR*)
DBEVENTINFO dbei = { sizeof(dbei) };
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
return 1;
- if ((dbei.pBlob=(PBYTE) mir_alloc(dbei.cbBlob)) == NULL)
+
+ mir_ptr<BYTE> pBlob((PBYTE) mir_alloc(dbei.cbBlob));
+ if ((dbei.pBlob = pBlob) == NULL)
return 1;
- if (db_event_get(hDbEvent, &dbei)) {
- mir_free(dbei.pBlob);
+
+ if (db_event_get(hDbEvent, &dbei))
return 1;
- }
- if (dbei.eventType != EVENTTYPE_AUTHREQUEST) {
- mir_free(dbei.pBlob);
+
+ if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
return 1;
- }
- if (strcmp(dbei.szModule, m_szModuleName)) {
- mir_free(dbei.pBlob);
+
+ if (strcmp(dbei.szModule, m_szModuleName))
return 1;
- }
char *nick = (char*)(dbei.pBlob + sizeof(DWORD)*2);
char *firstName = nick + strlen(nick) + 1;
@@ -509,12 +507,8 @@ int CJabberProto::AuthDeny(HANDLE hDbEvent, const TCHAR*)
Log("Send 'authorization denied' to %s", jid);
- TCHAR *newJid = dbei.flags & DBEF_UTF ? mir_utf8decodeT(jid) : mir_a2t(jid);
-
- m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), newJid) << XATTR(_T("type"), _T("unsubscribed")));
-
- mir_free(newJid);
- mir_free(dbei.pBlob);
+ ptrT newJid(dbei.flags & DBEF_UTF ? mir_utf8decodeT(jid) : mir_a2t(jid));
+ m_ThreadInfo->send( XmlNode(_T("presence")) << XATTR(_T("to"), newJid) << XATTR(_T("type"), _T("unsubscribed")));
return 0;
}
@@ -1388,9 +1382,7 @@ int __cdecl CJabberProto::SetAwayMsg(int status, const TCHAR *msg)
}
else {
// Update with the new mode message
- if (*szMsg != NULL)
- mir_free(*szMsg);
- *szMsg = newModeMsg;
+ replaceStrT(*szMsg, newModeMsg);
// Send a presence update if needed
lck.unlock();
if (status == m_iStatus)