diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-03-29 10:29:33 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-03-29 10:29:33 +0000 |
commit | a4b3fc9449de5684c987b41ba52105e30e415b50 (patch) | |
tree | 61f5d0df80aea1cc11ddab8f6edacc70a91aee2f /protocols | |
parent | a21c1d4a3f987b174a0178bca1430398852916f2 (diff) |
Facebook: Oops, don't let evil memory leak in Naseem's mode to eat all your memory
git-svn-id: http://svn.miranda-ng.org/main/trunk@8783 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 32ae2eb73d..c06143bc69 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -428,8 +428,10 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message*> messages, boo /// e.g. HANDLE hChatContact = proto->ChatIDToHContact(thread_id); ?
if (GetChatUsers(tthread_id.c_str()) == NULL) {
// In Naseem's spam mode we ignore outgoing messages sent from other instances
- if (naseemsSpamMode && !messages[i]->isIncoming)
+ if (naseemsSpamMode && !messages[i]->isIncoming) {
+ delete messages[i];
continue;
+ }
AddChat(tthread_id.c_str(), tthread_id.c_str()); // TODO: use correct name for chat, not thread_id
hChatContact = ChatIDToHContact(tthread_id);
@@ -452,8 +454,10 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message*> messages, boo MCONTACT hContact = ContactIDToHContact(fbu.user_id);
if (hContact == NULL) {
// In Naseem's spam mode we ignore outgoing messages sent from other instances
- if (naseemsSpamMode && !messages[i]->isIncoming)
+ if (naseemsSpamMode && !messages[i]->isIncoming) {
+ delete messages[i];
continue;
+ }
// We don't have this contact, lets load info about him
LoadContactInfo(&fbu);
|