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@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-10-19 10:39:26 +08:00 committed by Alexandre Julliard
parent 82938e833f
commit 5b7397bb27
1 changed files with 1 additions and 0 deletions

View File

@ -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),