Commit e55515bf authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 182feddd
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment