Although it's unlikely, RegCloseKey() may close an already closed key if the following SetupDiGetDeviceRegistryPropertyW() failed.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- 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),