Initialize pointer

This commit is contained in:
BlackMark 2020-07-05 18:53:12 +02:00
parent 9e8a6f4805
commit 07c189d399

View File

@ -39,7 +39,7 @@ static QString getLastErrorString()
{
DWORD lastErrorId = GetLastError();
TCHAR* msgBuf;
TCHAR* msgBuf = nullptr;
const auto formatFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS;
if(FormatMessage(formatFlags, nullptr, lastErrorId, 0, reinterpret_cast<LPTSTR>(&msgBuf), 0, nullptr) == 0) {