Commit 4c200a20 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

kernel32: Fix some memory leaks in set_wow64_environment().

parent 0512adff
......@@ -605,9 +605,13 @@ static void set_wow64_environment(void)
{
if (is_win64 || is_wow64) SetEnvironmentVariableW( progw6432W, value );
if (is_win64 || !is_wow64) SetEnvironmentVariableW( progfilesW, value );
HeapFree( GetProcessHeap(), 0, value );
}
if (is_wow64 && (value = get_reg_value( hkey, progdir86W )))
{
SetEnvironmentVariableW( progfilesW, value );
HeapFree( GetProcessHeap(), 0, value );
}
/* set the CommonProgramFiles variables */
......@@ -615,9 +619,13 @@ static void set_wow64_environment(void)
{
if (is_win64 || is_wow64) SetEnvironmentVariableW( commonw6432W, value );
if (is_win64 || !is_wow64) SetEnvironmentVariableW( commonfilesW, value );
HeapFree( GetProcessHeap(), 0, value );
}
if (is_wow64 && (value = get_reg_value( hkey, commondir86W )))
{
SetEnvironmentVariableW( commonfilesW, value );
HeapFree( GetProcessHeap(), 0, value );
}
NtClose( hkey );
}
......
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