Commit 211e4fc0 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

msxml3: Fix double-free of BSTR in domdoc tests.

Using the _bstr_ allocator adds the returned string to a cache, so the string shouldn't be freed with SysFreeString. Therefore, just replace the lone call to _bstr_ in this function by a straight call to SysAllocString.
parent b84201dc
...@@ -209,6 +209,9 @@ static const CHAR szBasicTransformOutput[] = ...@@ -209,6 +209,9 @@ static const CHAR szBasicTransformOutput[] =
static const WCHAR szNonExistentFile[] = { static const WCHAR szNonExistentFile[] = {
'c', ':', '\\', 'N', 'o', 'n', 'e', 'x', 'i', 's', 't', 'e', 'n', 't', '.', 'x', 'm', 'l', 0 'c', ':', '\\', 'N', 'o', 'n', 'e', 'x', 'i', 's', 't', 'e', 'n', 't', '.', 'x', 'm', 'l', 0
}; };
static const WCHAR szNonExistentAttribute[] = {
'n','o','n','E','x','i','s','i','t','i','n','g','A','t','t','r','i','b','u','t','e',0
};
static const WCHAR szDocument[] = { static const WCHAR szDocument[] = {
'#', 'd', 'o', 'c', 'u', 'm', 'e', 'n', 't', 0 '#', 'd', 'o', 'c', 'u', 'm', 'e', 'n', 't', 0
}; };
...@@ -1110,7 +1113,7 @@ static void test_domnode( void ) ...@@ -1110,7 +1113,7 @@ static void test_domnode( void )
SysFreeString( str ); SysFreeString( str );
attr = (IXMLDOMAttribute*)0xdeadbeef; attr = (IXMLDOMAttribute*)0xdeadbeef;
str = _bstr_("nonExisitingAttribute"); str = SysAllocString( szNonExistentAttribute );
r = IXMLDOMElement_getAttributeNode( element, str, &attr); r = IXMLDOMElement_getAttributeNode( element, str, &attr);
ok( r == S_FALSE, "getAttributeNode ret %08x\n", r ); ok( r == S_FALSE, "getAttributeNode ret %08x\n", r );
ok( attr == NULL, "getAttributeNode ret %p, expected NULL\n", attr ); ok( attr == NULL, "getAttributeNode ret %p, expected NULL\n", attr );
......
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