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) ...@@ -1006,12 +1006,16 @@ static BOOL get_program_files_dir(LPSTR buf, LPSTR buf2)
return FALSE; return FALSE;
size = MAX_PATH; 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; return FALSE;
}
size = MAX_PATH; 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; return FALSE;
}
RegCloseKey(hkey); RegCloseKey(hkey);
return TRUE; 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