Module: wine Branch: master Commit: fb0b55c52056e9dc6358857b13f534b2579b64ab URL: https://gitlab.winehq.org/wine/wine/-/commit/fb0b55c52056e9dc6358857b13f534b...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Mon Mar 20 19:44:58 2023 +0200
mshtml: Fix nsuri leak if create_channelbsc failed.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/mshtml/persist.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 78e8f609187..b1ec172f912 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -378,20 +378,22 @@ HRESULT set_moniker(HTMLOuterWindow *window, IMoniker *mon, IUri *nav_uri, IBind hres = create_doc_uri(uri, &nsuri); if(!nav_uri) IUri_Release(uri); - if(SUCCEEDED(hres)) { - if(async_bsc) - bscallback = async_bsc; - else - hres = create_channelbsc(mon, NULL, NULL, 0, TRUE, &bscallback); + if(FAILED(hres)) { + CoTaskMemFree(url); + return hres; }
+ if(async_bsc) + bscallback = async_bsc; + else + hres = create_channelbsc(mon, NULL, NULL, 0, TRUE, &bscallback); + if(SUCCEEDED(hres)) { if(window->base.inner_window->doc) remove_target_tasks(window->base.inner_window->task_magic); abort_window_bindings(window->base.inner_window);
hres = load_nsuri(window, nsuri, NULL, bscallback, LOAD_FLAGS_BYPASS_CACHE); - nsISupports_Release((nsISupports*)nsuri); /* FIXME */ if(SUCCEEDED(hres)) { hres = create_pending_window(window, bscallback); TRACE("pending window for %p %p %p\n", window, bscallback, window->pending_window); @@ -399,6 +401,7 @@ HRESULT set_moniker(HTMLOuterWindow *window, IMoniker *mon, IUri *nav_uri, IBind if(bscallback != async_bsc) IBindStatusCallback_Release(&bscallback->bsc.IBindStatusCallback_iface); } + nsISupports_Release((nsISupports*)nsuri); /* FIXME */
if(FAILED(hres)) { CoTaskMemFree(url);