diff options
author | George Hazan <ghazan@miranda.im> | 2021-06-05 17:50:34 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-06-05 17:50:34 +0300 |
commit | d7c9eb34f80f207efd47d2fc65e31aedf166c323 (patch) | |
tree | 338b9b905674dc31b1efab739dfcedeed3d8d7b3 /plugins/Variables | |
parent | ffc5a3d7550528281976745279e77ac9faba551b (diff) |
major code cleaning in regard to db_event_getBlobSize & event memory allocation
Diffstat (limited to 'plugins/Variables')
-rw-r--r-- | plugins/Variables/src/parse_miranda.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index b2687e5490..452989048d 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -564,17 +564,12 @@ static wchar_t* parseDbEvent(ARGUMENTSINFO *ai) if (hDbEvent == NULL)
return nullptr;
- DBEVENTINFO dbe = {};
- dbe.cbBlob = db_event_getBlobSize(hDbEvent);
- dbe.pBlob = (PBYTE)mir_calloc(dbe.cbBlob);
- if (db_event_get(hDbEvent, &dbe)) {
- mir_free(dbe.pBlob);
+ DB::EventInfo dbe;
+ dbe.cbBlob = -1;
+ if (db_event_get(hDbEvent, &dbe))
return nullptr;
- }
- wchar_t *res = DbEvent_GetTextW(&dbe, CP_ACP);
- mir_free(dbe.pBlob);
- return res;
+ return DbEvent_GetTextW(&dbe, CP_ACP);
}
static wchar_t* parseTranslate(ARGUMENTSINFO *ai)
|