wbemdisp: Fix a crash on null interface pointer.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a1ee6fa8dd
commit
1fda7ca72e
|
@ -1224,7 +1224,8 @@ static ULONG WINAPI locator_Release(
|
|||
if (!refs)
|
||||
{
|
||||
TRACE( "destroying %p\n", locator );
|
||||
IWbemLocator_Release( locator->locator );
|
||||
if (locator->locator)
|
||||
IWbemLocator_Release( locator->locator );
|
||||
heap_free( locator );
|
||||
}
|
||||
return refs;
|
||||
|
|
|
@ -243,9 +243,23 @@ static void test_ParseDisplayName(void)
|
|||
IParseDisplayName_Release( displayname );
|
||||
}
|
||||
|
||||
static void test_locator(void)
|
||||
{
|
||||
IUnknown *locator;
|
||||
HRESULT hr;
|
||||
|
||||
hr = CoCreateInstance( &CLSID_SWbemLocator, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&locator );
|
||||
ok( hr == S_OK, "got %x\n", hr );
|
||||
|
||||
IUnknown_Release( locator );
|
||||
}
|
||||
|
||||
START_TEST(wbemdisp)
|
||||
{
|
||||
CoInitialize( NULL );
|
||||
|
||||
test_ParseDisplayName();
|
||||
test_locator();
|
||||
|
||||
CoUninitialize();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue