Module: wine Branch: master Commit: 9f47704f1ae72d3e5d806709e2682da029f2a794 URL: https://gitlab.winehq.org/wine/wine/-/commit/9f47704f1ae72d3e5d806709e2682da...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Tue Aug 23 17:31:21 2022 +0300
mshtml: Handle S_FALSE return values from IUri methods.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/mshtml/main.c | 6 ++++-- dlls/mshtml/persist.c | 3 ++- dlls/mshtml/script.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/main.c b/dlls/mshtml/main.c index 1a64bdb9b7d..26c689ea016 100644 --- a/dlls/mshtml/main.c +++ b/dlls/mshtml/main.c @@ -215,7 +215,7 @@ compat_mode_t get_max_compat_mode(IUri *uri) { compat_config_t *iter; size_t len, iter_len; - BSTR host; + BSTR host = NULL; HRESULT hres;
static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; @@ -224,8 +224,10 @@ compat_mode_t get_max_compat_mode(IUri *uri) if(!uri) return global_max_compat_mode; hres = IUri_GetHost(uri, &host); - if(FAILED(hres)) + if(hres != S_OK) { + SysFreeString(host); return global_max_compat_mode; + } len = SysStringLen(host);
LIST_FOR_EACH_ENTRY(iter, &compat_config, compat_config_t, entry) { diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 73f255e753d..49e78ecfbc2 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -1176,7 +1176,8 @@ static HRESULT WINAPI HlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfHLNF, L if (FAILED(hres)) return hres;
- ShellExecuteW(NULL, L"open", uri, NULL, NULL, SW_SHOW); + if(hres == S_OK) + ShellExecuteW(NULL, L"open", uri, NULL, NULL, SW_SHOW); SysFreeString(uri); return S_OK; } diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c index 769ca72db6f..44211a6e0f2 100644 --- a/dlls/mshtml/script.c +++ b/dlls/mshtml/script.c @@ -1123,7 +1123,7 @@ HRESULT load_script(HTMLScriptElement *script_elem, const WCHAR *src, BOOL async
hres = IUri_GetScheme(uri, &bsc->scheme); IUri_Release(uri); - if(FAILED(hres)) + if(hres != S_OK) bsc->scheme = URL_SCHEME_UNKNOWN;
IHTMLScriptElement_AddRef(&script_elem->IHTMLScriptElement_iface);