[OPENGLCFG] Fix crash if no drivers (#1919)

Actually, it crashes here on Windows XP.
This commit is contained in:
Carlo Bramini 2019-09-21 15:58:38 +02:00 committed by Hermès BÉLUSCA - MAÏTO
parent c57d4d7b9e
commit e7b8f27309

View file

@ -190,13 +190,14 @@ INT_PTR CALLBACK GeneralPageProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM
break;
case WM_DESTROY:
{
if (pOglDrivers != NULL)
{
INT iKey;
for (iKey = 0; iKey <= dwNumDrivers; iKey++)
HeapFree(GetProcessHeap(), 0, pOglDrivers[iKey]);
HeapFree(GetProcessHeap(), 0, pOglDrivers);
}
}
}
return FALSE;