Commit a2484183 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

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

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