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/YARelay/src/main.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'plugins/YARelay/src') diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index 4a29fedc9f..5abc1cbc44 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -113,12 +113,8 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent) return 0; // receive message from DB - DBEVENTINFO dbei = {}; - dbei.cbBlob = db_event_getBlobSize(hDBEvent); - if (dbei.cbBlob == -1) - return 0; - - dbei.pBlob = (unsigned char*)alloca(dbei.cbBlob); + DB::EventInfo dbei; + dbei.cbBlob = -1; db_event_get(hDBEvent, &dbei); if (dbei.flags & DBEF_SENT || dbei.flags & DBEF_READ || (dbei.eventType != EVENTTYPE_MESSAGE)) return 0; -- cgit v1.2.3