summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_avatars.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-09-16 18:52:29 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-09-16 18:52:29 +0000
commit3c00a78191f46c10f036c789a9ef358f0e049d61 (patch)
tree96741c418983d401ebba418b579793c8c4959d30 /protocols/Tox/src/tox_avatars.cpp
parentab46b98479555c7106087f7d62b6c89f320ca311 (diff)
Tox:
- attempt to fix numerous crashes git-svn-id: http://svn.miranda-ng.org/main/trunk@15366 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_avatars.cpp')
-rw-r--r--protocols/Tox/src/tox_avatars.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/protocols/Tox/src/tox_avatars.cpp b/protocols/Tox/src/tox_avatars.cpp
index 47c50d3fc2..efa04e6861 100644
--- a/protocols/Tox/src/tox_avatars.cpp
+++ b/protocols/Tox/src/tox_avatars.cpp
@@ -10,8 +10,10 @@ TCHAR* CToxProto::GetAvatarFilePath(MCONTACT hContact)
CreateDirectoryTreeT(path);
ptrT address(getTStringA(hContact, TOX_SETTINGS_ID));
- if (address == NULL)
+ if (address == NULL) {
+ mir_free(path);
return mir_tstrdup(_T(""));
+ }
if (hContact && mir_tstrlen(address) > TOX_PUBLIC_KEY_SIZE * 2)
address[TOX_PUBLIC_KEY_SIZE * 2] = 0;
@@ -30,7 +32,7 @@ void CToxProto::SetToxAvatar(const TCHAR* path)
}
fseek(hFile, 0, SEEK_END);
- size_t length = ftell(hFile);
+ long length = ftell(hFile);
rewind(hFile);
if (length > TOX_MAX_AVATAR_SIZE)
{