Commit 1fda7ca7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wbemdisp: Fix a crash on null interface pointer.

parent a1ee6fa8
......@@ -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();
}
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