summaryrefslogtreecommitdiff
path: root/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/win32/source/odbcconfig/odbcconfig.cxx')
-rw-r--r--dbaccess/win32/source/odbcconfig/odbcconfig.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/dbaccess/win32/source/odbcconfig/odbcconfig.cxx b/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
index 86f8e67c4071..73eb04a74d57 100644
--- a/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
+++ b/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
@@ -44,10 +44,9 @@ int displayLastError()
{
DWORD dwError = GetLastError();
- LPVOID lpMsgBuf;
+ LPVOID lpMsgBuf = nullptr;
FormatMessageW(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM,
+ FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
nullptr,
dwError,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
@@ -60,7 +59,7 @@ int displayLastError()
MessageBoxW( nullptr, static_cast<LPCWSTR>(lpMsgBuf), nullptr, MB_OK | MB_ICONERROR );
// Free the buffer.
- LocalFree( lpMsgBuf );
+ HeapFree( GetProcessHeap(), 0, lpMsgBuf );
return dwError;
}