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

This commit is contained in:
Jacek Caban 2012-10-19 11:57:30 +02:00 committed by Alexandre Julliard
parent 08485aeb48
commit 4638fbf167
1 changed files with 9 additions and 2 deletions

View File

@ -666,6 +666,9 @@ static ScriptHost *create_script_host(HTMLInnerWindow *window, const GUID *guid)
HRESULT hres;
ret = heap_alloc_zero(sizeof(*ret));
if(!ret)
return NULL;
ret->IActiveScriptSite_iface.lpVtbl = &ActiveScriptSiteVtbl;
ret->IActiveScriptSiteInterruptPoll_iface.lpVtbl = &ActiveScriptSiteInterruptPollVtbl;
ret->IActiveScriptSiteWindow_iface.lpVtbl = &ActiveScriptSiteWindowVtbl;
@ -944,6 +947,9 @@ IDispatch *script_parse_event(HTMLInnerWindow *window, LPCWSTR text)
BOOL b;
language = heap_alloc((ptr-text+1)*sizeof(WCHAR));
if(!language)
return NULL;
memcpy(language, text, (ptr-text)*sizeof(WCHAR));
language[ptr-text] = 0;
@ -1207,9 +1213,10 @@ void bind_event_scripts(HTMLDocumentNode *doc)
if(event_disp) {
event_target = find_event_target(doc, script_elem);
if(event_target) {
IHTMLElement_QueryInterface(&event_target->IHTMLElement_iface, &IID_HTMLPluginContainer, (void**)&plugin_container);
hres = IHTMLElement_QueryInterface(&event_target->IHTMLElement_iface, &IID_HTMLPluginContainer,
(void**)&plugin_container);
if(plugin_container)
if(SUCCEEDED(hres))
bind_activex_event(doc, plugin_container, event, event_disp);
else
bind_elem_event(doc, event_target, event, event_disp);