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 --- protocols/Steam/src/steam_proto.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'protocols/Steam/src') diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 35bef1b6db..4b05b6c32d 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -109,17 +109,14 @@ MCONTACT CSteamProto::AddToList(int, PROTOSEARCHRESULT *psr) MCONTACT CSteamProto::AddToListByEvent(int, int, MEVENT hDbEvent) { - DBEVENTINFO dbei = {}; - if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1)) - return NULL; - if ((dbei.pBlob = (PBYTE)alloca(dbei.cbBlob)) == nullptr) - return NULL; + DB::EventInfo dbei; + dbei.cbBlob = -1; if (db_event_get(hDbEvent, &dbei)) - return NULL; + return 0; if (mir_strcmp(dbei.szModule, m_szModuleName)) - return NULL; + return 0; if (dbei.eventType != EVENTTYPE_AUTHREQUEST) - return NULL; + return 0; DB::AUTH_BLOB blob(dbei.pBlob); return AddContact(blob.get_email(), Utf2T(blob.get_nick())); -- cgit v1.2.3