summaryrefslogtreecommitdiff
path: root/protocols/Telegram
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-07-15 20:53:18 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-07-15 20:53:18 +0300
commit36bae0cb914a64f5c9ce9a8e2b606b53cef7fd88 (patch)
tree575099ade38d4d9b9cd6540111c6c1c74d26c23c /protocols/Telegram
parent4d84561727b143ddb3f905356c63e7609791dbc7 (diff)
memory leak fix
Diffstat (limited to 'protocols/Telegram')
-rw-r--r--protocols/Telegram/src/avatars.cpp1
-rw-r--r--protocols/Telegram/src/proto.h6
2 files changed, 5 insertions, 2 deletions
diff --git a/protocols/Telegram/src/avatars.cpp b/protocols/Telegram/src/avatars.cpp
index de4d74f2ee..c5f60605ac 100644
--- a/protocols/Telegram/src/avatars.cpp
+++ b/protocols/Telegram/src/avatars.cpp
@@ -219,7 +219,6 @@ void CTelegramProto::ProcessFile(TD::updateFile *pObj)
for (auto &it : m_arUsers) {
if (it->szAvatarHash == pFile->remote_->unique_id_.c_str()) {
-
PROTO_AVATAR_INFORMATION pai;
pai.hContact = it->hContact;
pai.format = ProtoGetAvatarFileFormat(wszExistingFile);
diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h
index e83ed8ae6d..4fefc25766 100644
--- a/protocols/Telegram/src/proto.h
+++ b/protocols/Telegram/src/proto.h
@@ -71,6 +71,10 @@ struct TG_FILE_REQUEST : public MZeroedObject
m_uniqueId(_3)
{}
+ ~TG_FILE_REQUEST()
+ { delete ofd;
+ }
+
void AutoDetectType();
Type m_type;
@@ -78,7 +82,7 @@ struct TG_FILE_REQUEST : public MZeroedObject
TD::int53 m_fileId, m_fileSize = 0;
CMStringA m_uniqueId;
CMStringW m_destPath, m_fileName, m_wszDescr;
- OFDTHREAD *ofd;
+ OFDTHREAD *ofd = 0;
};
struct TG_USER : public MZeroedObject