mshtml: Handle memory allocation failure when creating IOleUndoManager.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
49bdb815bf
commit
e8b9bda53a
|
@ -197,6 +197,8 @@ static IOleUndoManager *create_undomgr(void)
|
|||
{
|
||||
UndoManager *ret = heap_alloc(sizeof(UndoManager));
|
||||
|
||||
if (!ret) return NULL;
|
||||
|
||||
ret->IOleUndoManager_iface.lpVtbl = &OleUndoManagerVtbl;
|
||||
ret->ref = 1;
|
||||
|
||||
|
@ -246,6 +248,9 @@ static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFG
|
|||
if(!This->doc_obj->undomgr)
|
||||
This->doc_obj->undomgr = create_undomgr();
|
||||
|
||||
if (!This->doc_obj->undomgr)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
return IOleUndoManager_QueryInterface(This->doc_obj->undomgr, riid, ppv);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue