From e7b8f273094c9402ff1df3baa5841bf3518a3f02 Mon Sep 17 00:00:00 2001 From: Carlo Bramini <30959007+carlo-bramini@users.noreply.github.com> Date: Sat, 21 Sep 2019 15:58:38 +0200 Subject: [PATCH] [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; -- 2.17.1