Commit 525a5510 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

msxml3: Handle get_element returning NULL (Coverity).

parent 3b86f463
...@@ -644,6 +644,7 @@ static HRESULT WINAPI domelem_getElementsByTagName( ...@@ -644,6 +644,7 @@ static HRESULT WINAPI domelem_getElementsByTagName(
{ {
domelem *This = impl_from_IXMLDOMElement( iface ); domelem *This = impl_from_IXMLDOMElement( iface );
LPWSTR szPattern; LPWSTR szPattern;
xmlNodePtr element;
HRESULT hr; HRESULT hr;
TRACE("(%p)->(%s,%p)\n", This, debugstr_w(bstrName), resultList); TRACE("(%p)->(%s,%p)\n", This, debugstr_w(bstrName), resultList);
...@@ -654,7 +655,11 @@ static HRESULT WINAPI domelem_getElementsByTagName( ...@@ -654,7 +655,11 @@ static HRESULT WINAPI domelem_getElementsByTagName(
lstrcpyW(szPattern+3, bstrName); lstrcpyW(szPattern+3, bstrName);
TRACE("%s\n", debugstr_w(szPattern)); 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); HeapFree(GetProcessHeap(), 0, szPattern);
return hr; return hr;
......
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