From 3aa7b877f7e175a214521e920a4829636db3a2c3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 Jul 2012 22:26:22 +0000 Subject: warning fix git-svn-id: http://svn.miranda-ng.org/main/trunk@1174 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Import/src/import.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 4b66ec8054..f50dc24de1 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -325,7 +325,8 @@ static void ImportHistory(HANDLE hContact, PROTOACCOUNT **protocol, int protoCou return; } - int i = 0, skipAll = 0, cbAlloc = 4096; + int i = 0, skipAll = 0; + DWORD cbAlloc = 4096; BYTE* eventBuf = (PBYTE)mir_alloc(cbAlloc); bool bIsVoidContact = dstDb->GetEventCount(hDst) == 0; @@ -338,8 +339,8 @@ static void ImportHistory(HANDLE hContact, PROTOACCOUNT **protocol, int protoCou DBEVENTINFO dbei = { sizeof(DBEVENTINFO) }; dbei.cbBlob = srcDb->GetBlobSize(hEvent); if (dbei.cbBlob > cbAlloc) { - dbei.cbBlob += 4096 - dbei.cbBlob%4096; - eventBuf = (PBYTE)mir_realloc(eventBuf, dbei.cbBlob); + cbAlloc = dbei.cbBlob + 4096 - dbei.cbBlob%4096; + eventBuf = (PBYTE)mir_realloc(eventBuf, cbAlloc); } dbei.pBlob = eventBuf; @@ -424,6 +425,7 @@ static void ImportHistory(HANDLE hContact, PROTOACCOUNT **protocol, int protoCou hEvent = srcDb->FindNextEvent(hEvent); i++; } + mir_free(eventBuf); } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3