Commit 23c87ba8 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Properly handle OOM errors in htmlnode.c (coverity).

parent b6227fc4
......@@ -282,6 +282,9 @@ static IHTMLDOMChildrenCollection *create_child_collection(HTMLDocumentNode *doc
HTMLDOMChildrenCollection *ret;
ret = heap_alloc_zero(sizeof(*ret));
if(!ret)
return NULL;
ret->IHTMLDOMChildrenCollection_iface.lpVtbl = &HTMLDOMChildrenCollectionVtbl;
ret->ref = 1;
......@@ -468,7 +471,7 @@ static HRESULT WINAPI HTMLDOMNode_get_childNodes(IHTMLDOMNode *iface, IDispatch
*p = (IDispatch*)create_child_collection(This->doc, nslist);
nsIDOMNodeList_Release(nslist);
return S_OK;
return *p ? S_OK : E_OUTOFMEMORY;
}
static HRESULT WINAPI HTMLDOMNode_get_attributes(IHTMLDOMNode *iface, IDispatch **p)
......@@ -1072,8 +1075,7 @@ void HTMLDOMNode_Init(HTMLDocumentNode *doc, HTMLDOMNode *node, nsIDOMNode *nsno
htmldoc_addref(&doc->basedoc);
node->doc = doc;
if(nsnode)
nsIDOMNode_AddRef(nsnode);
nsIDOMNode_AddRef(nsnode);
node->nsnode = nsnode;
nsres = nsIDOMNode_SetMshtmlNode(nsnode, (nsISupports*)&node->IHTMLDOMNode_iface);
......
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