From d7c9eb34f80f207efd47d2fc65e31aedf166c323 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 5 Jun 2021 17:50:34 +0300 Subject: major code cleaning in regard to db_event_getBlobSize & event memory allocation --- plugins/StopSpamMod/src/stopspam.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'plugins/StopSpamMod/src') diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index b32afb3e90..f1e7ca9361 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -19,14 +19,11 @@ int OnDbEventAdded(WPARAM hContact, LPARAM hDbEvent) { - DBEVENTINFO dbei = {}; - dbei.cbBlob = db_event_getBlobSize(hDbEvent); - if (dbei.cbBlob == -1) + DB::EventInfo dbei; + dbei.cbBlob = -1; + if (db_event_get(hDbEvent, &dbei)) return 0; - dbei.pBlob = (BYTE*)alloca(dbei.cbBlob); - db_event_get(hDbEvent, &dbei); - // if event is in protocol that is not despammed if (!ProtoInList(dbei.szModule)) return 0; -- cgit v1.2.3