Module: wine Branch: oldstable Commit: 1a6c8f4f7d2a00c764554a4fd59a002c3e1599bb URL: https://source.winehq.org/git/wine.git/?a=commit;h=1a6c8f4f7d2a00c764554a4fd...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Mon Dec 4 14:56:15 2017 +0300
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 (cherry picked from commit 2b37b97d0c6356f8b89401183295222123e4b619) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/mshtml/persist.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 2735ab5..408bc00 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -892,10 +892,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; } @@ -950,10 +949,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; }