summaryrefslogtreecommitdiff
path: root/protocols/Steam
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-06-05 17:50:34 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-06-05 17:50:34 +0300
commitd7c9eb34f80f207efd47d2fc65e31aedf166c323 (patch)
tree338b9b905674dc31b1efab739dfcedeed3d8d7b3 /protocols/Steam
parentffc5a3d7550528281976745279e77ac9faba551b (diff)
major code cleaning in regard to db_event_getBlobSize & event memory allocation
Diffstat (limited to 'protocols/Steam')
-rw-r--r--protocols/Steam/src/steam_proto.cpp13
1 files changed, 5 insertions, 8 deletions
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()));