Commit c54219fb authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

msi/tests: Do not leak a HKEY when RegQueryValueEx failed.

parent 44fd06f4
......@@ -1006,12 +1006,16 @@ static BOOL get_program_files_dir(LPSTR buf, LPSTR buf2)
return FALSE;
size = MAX_PATH;
if (RegQueryValueEx(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)buf, &size))
if (RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)buf, &size)) {
RegCloseKey(hkey);
return FALSE;
}
size = MAX_PATH;
if (RegQueryValueEx(hkey, "CommonFilesDir", 0, &type, (LPBYTE)buf2, &size))
if (RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)buf2, &size)) {
RegCloseKey(hkey);
return FALSE;
}
RegCloseKey(hkey);
return TRUE;
......
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