msxml3: Handle get_element returning NULL (Coverity).

This commit is contained in:
Marcus Meissner 2009-01-28 23:25:16 +01:00 committed by Alexandre Julliard
parent 3b86f463b5
commit 525a5510d1
1 changed files with 6 additions and 1 deletions

View File

@ -644,6 +644,7 @@ static HRESULT WINAPI domelem_getElementsByTagName(
{
domelem *This = impl_from_IXMLDOMElement( iface );
LPWSTR szPattern;
xmlNodePtr element;
HRESULT hr;
TRACE("(%p)->(%s,%p)\n", This, debugstr_w(bstrName), resultList);
@ -654,7 +655,11 @@ static HRESULT WINAPI domelem_getElementsByTagName(
lstrcpyW(szPattern+3, bstrName);
TRACE("%s\n", debugstr_w(szPattern));
hr = queryresult_create(get_element(This), szPattern, resultList);
element = get_element(This);
if (!element)
hr = E_FAIL;
else
hr = queryresult_create(element, szPattern, resultList);
HeapFree(GetProcessHeap(), 0, szPattern);
return hr;