win32u: Fix a memory leak.
The subkey handle is leaked when deleting a GPU entry succeeded. Also, there is no need to restart the enumeration for the grandparent key hkey. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
182feddd4b
commit
e55515bf5b
|
@ -702,7 +702,6 @@ static void cleanup_devices(void)
|
|||
|
||||
hkey = reg_open_key( enum_key, pciW, sizeof(pciW) );
|
||||
|
||||
restart:
|
||||
while (!NtEnumerateKey( hkey, i++, KeyNodeInformation, key, sizeof(buffer), &size ))
|
||||
{
|
||||
unsigned int j = 0;
|
||||
|
@ -735,7 +734,7 @@ restart:
|
|||
NtClose( device_key );
|
||||
|
||||
if (!present && reg_delete_tree( subkey, bufferW, lstrlenW( bufferW ) * sizeof(WCHAR) ))
|
||||
goto restart;
|
||||
j = 0;
|
||||
}
|
||||
|
||||
NtClose( subkey );
|
||||
|
|
Loading…
Reference in New Issue