https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e7b8f273094c9402ff1df3baa5841bf3518a3f02

commit e7b8f273094c9402ff1df3baa5841bf3518a3f02
Author:     Carlo Bramini <[email protected]>
AuthorDate: Sat Sep 21 15:58:38 2019 +0200
Commit:     Hermès BÉLUSCA - MAÏTO <[email protected]>
CommitDate: Sat Sep 21 15:58:38 2019 +0200

    [OPENGLCFG] Fix crash if no drivers (#1919)
    
    Actually, it crashes here on Windows XP.
---
 dll/cpl/openglcfg/general.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dll/cpl/openglcfg/general.c b/dll/cpl/openglcfg/general.c
index f9376ed0b8c..69170a4232f 100644
--- a/dll/cpl/openglcfg/general.c
+++ b/dll/cpl/openglcfg/general.c
@@ -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;

Reply via email to