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

oldstable
Jacek Caban 2012-10-19 11:57:47 +02:00 committed by Alexandre Julliard
parent 4638fbf167
commit 3a4a4acd1a
2 changed files with 4 additions and 1 deletions

View File

@ -803,7 +803,7 @@ static HRESULT WINAPI HTMLWindow2_get_navigator(IHTMLWindow2 *iface, IOmNavigato
TRACE("(%p)->(%p)\n", This, p);
*p = OmNavigator_Create();
return S_OK;
return *p ? S_OK : E_OUTOFMEMORY;
}
static HRESULT WINAPI HTMLWindow2_put_name(IHTMLWindow2 *iface, BSTR v)

View File

@ -941,6 +941,9 @@ IOmNavigator *OmNavigator_Create(void)
OmNavigator *ret;
ret = heap_alloc_zero(sizeof(*ret));
if(!ret)
return NULL;
ret->IOmNavigator_iface.lpVtbl = &OmNavigatorVtbl;
ret->ref = 1;