Sebastian Lackner : wbemprox/tests: Fix memory leak when tests are skipped.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue May 5 09:50:51 CDT 2015
Module: wine
Branch: master
Commit: a248418325bb4a4405a8a3c357052e7f5991af5e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a248418325bb4a4405a8a3c357052e7f5991af5e
Author: Sebastian Lackner <sebastian at fds-team.de>
Date: Fri Apr 17 07:58:06 2015 +0200
wbemprox/tests: Fix memory leak when tests are skipped.
---
dlls/wbemprox/tests/query.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c
index 8fd027e..56c97ff 100644
--- a/dlls/wbemprox/tests/query.c
+++ b/dlls/wbemprox/tests/query.c
@@ -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 );
}
More information about the wine-cvs
mailing list