mshtml: Avoid potential moniker instance leak.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-12-04 14:56:15 +03:00 committed by Alexandre Julliard
parent 71eac4a70b
commit 2b37b97d0c
1 changed files with 4 additions and 6 deletions

View File

@ -918,10 +918,9 @@ static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream
prepare_for_binding(This, mon, FALSE);
hres = set_moniker(This->window, mon, NULL, NULL, NULL, TRUE);
if(FAILED(hres))
return hres;
if(SUCCEEDED(hres))
hres = channelbsc_load_stream(This->window->pending_window, mon, pStm);
hres = channelbsc_load_stream(This->window->pending_window, mon, pStm);
IMoniker_Release(mon);
return hres;
}
@ -976,10 +975,9 @@ static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
prepare_for_binding(This, mon, FALSE);
hres = set_moniker(This->window, mon, NULL, NULL, NULL, FALSE);
if(FAILED(hres))
return hres;
if(SUCCEEDED(hres))
hres = channelbsc_load_stream(This->window->pending_window, mon, NULL);
hres = channelbsc_load_stream(This->window->pending_window, mon, NULL);
IMoniker_Release(mon);
return hres;
}