diff options
Diffstat (limited to 'include/comphelper/windowserrorstring.hxx')
-rw-r--r-- | include/comphelper/windowserrorstring.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/comphelper/windowserrorstring.hxx b/include/comphelper/windowserrorstring.hxx index bb4b16241ca5..1b50f1eadb58 100644 --- a/include/comphelper/windowserrorstring.hxx +++ b/include/comphelper/windowserrorstring.hxx @@ -21,7 +21,7 @@ inline OUString WindowsErrorString(DWORD nErrorCode) { LPWSTR pMsgBuf; - if (FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + if (FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, nErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), @@ -33,7 +33,7 @@ inline OUString WindowsErrorString(DWORD nErrorCode) OUString result(o3tl::toU(pMsgBuf)); result.endsWith("\r\n", &result); - LocalFree(pMsgBuf); + HeapFree(GetProcessHeap(), 0, pMsgBuf); return result; } |