Commit e934d847 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

mshtml: Added error handling to get_doc_string.

parent 0bbc95e4
...@@ -334,6 +334,7 @@ static HRESULT get_doc_string(HTMLDocumentNode *This, char **str) ...@@ -334,6 +334,7 @@ static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)
LPCWSTR strw; LPCWSTR strw;
nsAString nsstr; nsAString nsstr;
nsresult nsres; nsresult nsres;
HRESULT hres;
if(!This->nsdoc) { if(!This->nsdoc) {
WARN("NULL nsdoc\n"); WARN("NULL nsdoc\n");
...@@ -347,8 +348,12 @@ static HRESULT get_doc_string(HTMLDocumentNode *This, char **str) ...@@ -347,8 +348,12 @@ static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)
} }
nsAString_Init(&nsstr, NULL); nsAString_Init(&nsstr, NULL);
nsnode_to_nsstring(nsnode, &nsstr); hres = nsnode_to_nsstring(nsnode, &nsstr);
nsIDOMNode_Release(nsnode); nsIDOMNode_Release(nsnode);
if(FAILED(hres)) {
nsAString_Finish(&nsstr);
return hres;
}
nsAString_GetData(&nsstr, &strw); nsAString_GetData(&nsstr, &strw);
TRACE("%s\n", debugstr_w(strw)); TRACE("%s\n", debugstr_w(strw));
...@@ -357,6 +362,8 @@ static HRESULT get_doc_string(HTMLDocumentNode *This, char **str) ...@@ -357,6 +362,8 @@ static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)
nsAString_Finish(&nsstr); nsAString_Finish(&nsstr);
if(!*str)
return E_OUTOFMEMORY;
return S_OK; return S_OK;
} }
......
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