Christian Inci chris.pcguy.inci@gmail.com writes:
@@ -3728,8 +3728,13 @@ static HKEY SETUPDI_OpenDrvKey(struct DeviceInfo *devInfo, REGSAM samDesired) WCHAR devId[10];
sprintfW(devId, fmt, devInfo->devId);
RegOpenKeyExW(classKey, devId, 0, samDesired, &key);
RegCloseKey(classKey);
l = RegOpenKeyExW(classKey, devId, 0, samDesired, &key);
if (!l) {
RegCloseKey(classKey);
} else {
SetLastError(ERROR_KEY_DOES_NOT_EXIST);
return INVALID_HANDLE_VALUE;
}
You are leaking the key now.