From 5b7397bb27968267e22cc9393dbcaf2cacb7798a Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 19 Oct 2021 10:39:26 +0800 Subject: [PATCH] winemac.drv: Set hkey to NULL after RegCloseKey() in macdrv_init_gpu(). Although it's unlikely, RegCloseKey() may close an already closed key if the following SetupDiGetDeviceRegistryPropertyW() failed. Signed-off-by: Zhiyi Zhang Signed-off-by: Alexandre Julliard --- dlls/winemac.drv/display.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index b32c553d411..4a3b1ff39cb 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -1601,6 +1601,7 @@ static BOOL macdrv_init_gpu(HDEVINFO devinfo, const struct macdrv_gpu *gpu, int if (RegSetValueExW(hkey, dac_typeW, 0, REG_BINARY, (const BYTE *)ramdacW, sizeof(ramdacW))) goto done; RegCloseKey(hkey); + hkey = NULL; /* Retrieve driver value for adapters */ if (!SetupDiGetDeviceRegistryPropertyW(devinfo, &device_data, SPDRP_DRIVER, NULL, (BYTE *)bufferW, sizeof(bufferW),