diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index ae96fa17909..704e92e85fd 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -743,8 +743,8 @@ static ULONG WINAPI Internal_Release( ref = InterlockedDecrement( &This->ref ); if ( ref == 0 ) { - assert( This->node->doc ); - xmldoc_release( This->node->doc ); + if( This->node ) + xmldoc_release( This->node->doc ); HeapFree( GetProcessHeap(), 0, This ); } diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index bb378c7f034..49c303bb908 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -513,6 +513,13 @@ static void test_refs(void) LONG ref; IUnknown *unk, *unk2; + r = CoCreateInstance( &CLSID_DOMDocument, NULL, + CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (LPVOID*)&doc ); + if( r != S_OK ) + return; + ref = IXMLDOMDocument_Release(doc); + ok( ref == 0, "ref %ld\n", ref); + r = CoCreateInstance( &CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (LPVOID*)&doc ); if( r != S_OK )