From 862c352908a9800c2721870e09a8decce5adc1da Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 31 Aug 2014 19:09:16 +0000 Subject: double memory allocation reverted git-svn-id: http://svn.miranda-ng.org/main/trunk@10349 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/msglog.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 86e25f8497..a448be6be0 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -1155,14 +1155,16 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG dat->bufferOffset = 0; switch (dat->stage) { case STREAMSTAGE_HEADER: - replaceStr(dat->buffer, CreateRTFHeader(dat->dlgDat)); + mir_free(dat->buffer); + dat->buffer = CreateRTFHeader(dat->dlgDat); dat->stage = STREAMSTAGE_EVENTS; break; case STREAMSTAGE_EVENTS: if (dat->eventsToInsert) { do { - replaceStr(dat->buffer, Template_CreateRTFFromDbEvent(dat->dlgDat, dat->hContact, dat->hDbEvent, !dat->isEmpty, dat)); + mir_free(dat->buffer); + dat->buffer = Template_CreateRTFFromDbEvent(dat->dlgDat, dat->hContact, dat->hDbEvent, !dat->isEmpty, dat); if (dat->buffer) dat->hDbEventLast = dat->hDbEvent; dat->hDbEvent = db_event_next(dat->hContact, dat->hDbEvent); @@ -1178,7 +1180,8 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG //fall through case STREAMSTAGE_TAIL: - replaceStr(dat->buffer, CreateRTFTail(dat->dlgDat)); + mir_free(dat->buffer); + dat->buffer = CreateRTFTail(dat->dlgDat); dat->stage = STREAMSTAGE_STOP; break; -- cgit v1.2.3