Module: wine Branch: master Commit: 5b7397bb27968267e22cc9393dbcaf2cacb7798a URL: https://source.winehq.org/git/wine.git/?a=commit;h=5b7397bb27968267e22cc9393... Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Oct 19 10:39:26 2021 +0800 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 <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- 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),