diff options
author | George Hazan <george.hazan@gmail.com> | 2013-07-20 21:28:27 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-07-20 21:28:27 +0000 |
commit | 71465258cce14f8d417ba31e3010298f7640ac2d (patch) | |
tree | 1fe57d014d8ae844000412429235a0c4297a41dc /protocols/JabberG/src/jabber_iq_handlers.cpp | |
parent | 5756772ef9e9fd5b4a730d8a16737996cbec55f5 (diff) |
- built-in base64 encode removed;
- various memory allocation issues
git-svn-id: http://svn.miranda-ng.org/main/trunk@5435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_iq_handlers.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_iq_handlers.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 6c88eb0e4b..dfacdd5bba 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -492,7 +492,7 @@ BOOL CJabberProto::OnIqRequestAvatar(HXML, CJabberIqInfo *pInfo) return TRUE;
long bytes = _filelength(_fileno(in));
- char* buffer = (char*)mir_alloc(bytes*4/3 + bytes + 1000);
+ ptrA buffer((char*)mir_alloc(bytes*4/3 + bytes + 1000));
if (buffer == NULL) {
fclose(in);
return TRUE;
@@ -501,10 +501,8 @@ BOOL CJabberProto::OnIqRequestAvatar(HXML, CJabberIqInfo *pInfo) fread(buffer, bytes, 1, in);
fclose(in);
- char* str = JabberBase64Encode(buffer, bytes);
+ ptrA str( mir_base64_encode((PBYTE)(char*)buffer, bytes));
m_ThreadInfo->send( XmlNodeIq(_T("result"), pInfo) << XQUERY(JABBER_FEAT_AVATAR) << XCHILD(_T("query"), _A2T(str)) << XATTR(_T("mimetype"), szMimeType));
- mir_free(str);
- mir_free(buffer);
return TRUE;
}
|