[OPENGLCFG] Fix crash if no drivers (#1919)
authorCarlo Bramini <30959007+carlo-bramini@users.noreply.github.com>
Sat, 21 Sep 2019 13:58:38 +0000 (15:58 +0200)
committerHermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Sat, 21 Sep 2019 13:58:38 +0000 (15:58 +0200)
Actually, it crashes here on Windows XP.

dll/cpl/openglcfg/general.c

index f9376ed..69170a4 100644 (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;