wbemprox/tests: Fix memory leak when tests are skipped.

This commit is contained in:
Sebastian Lackner 2015-04-17 07:58:06 +02:00 committed by Alexandre Julliard
parent a5414e8bed
commit a248418325
1 changed files with 5 additions and 3 deletions

View File

@ -158,7 +158,7 @@ static void test_Win32_Service( IWbemServices *services )
if (hr != S_OK)
{
win_skip( "Win32_Service not available\n" );
return;
goto out;
}
type = 0xdeadbeef;
VariantInit( &state );
@ -232,6 +232,7 @@ static void test_Win32_Service( IWbemServices *services )
ok( hr == S_OK, "got %08x\n", hr );
if (service) IWbemClassObject_Release( service );
out:
SysFreeString( empty );
SysFreeString( class );
}
@ -373,14 +374,14 @@ static void test_Win32_ComputerSystem( IWbemServices *services )
if (!compname[0] || !username[0])
{
skip( "Failed to get user or computer name\n" );
return;
goto out;
}
hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result );
if (hr != S_OK)
{
win_skip( "Win32_ComputerSystem not available\n" );
return;
goto out;
}
hr = IEnumWbemClassObject_Next( result, 10000, 1, &service, &count );
@ -406,6 +407,7 @@ static void test_Win32_ComputerSystem( IWbemServices *services )
IWbemClassObject_Release( service );
IEnumWbemClassObject_Release( result );
out:
SysFreeString( query );
SysFreeString( wql );
}