Re: setupapi: Fix SETUPDI_OpenDrvKey
8 Jul
2011
8 Jul
'11
1:28 p.m.
Christian Inci <chris.pcguy.inci(a)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. -- Alexandre Julliard julliard(a)winehq.org
5275
Age (days ago)
5275
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard