summaryrefslogtreecommitdiff
path: root/plugins/Import/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-24 22:26:22 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-24 22:26:22 +0000
commit3aa7b877f7e175a214521e920a4829636db3a2c3 (patch)
tree9940131d4be5a00603e44a8f6cf9d9511f96c749 /plugins/Import/src
parent6196997f1c28671bdec817a349db90e38cbb98d4 (diff)
warning fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@1174 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Import/src')
-rw-r--r--plugins/Import/src/import.cpp8
1 files 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);
}
/////////////////////////////////////////////////////////////////////////////////////////