ieframe/tests: Don't crash if IWebBrowser2_get_LocationURL() fails.

Francois Gouget fgouget at free.fr
Fri Sep 16 08:26:22 CDT 2011


---

This avoids a crash on my NT4 VM.

 dlls/ieframe/tests/webbrowser.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c
index 0506be6..229f79d 100644
--- a/dlls/ieframe/tests/webbrowser.c
+++ b/dlls/ieframe/tests/webbrowser.c
@@ -233,9 +233,12 @@ static void _test_LocationURL(unsigned line, IUnknown *unk, const char *exurl)
 
     hres = IWebBrowser2_get_LocationURL(wb, &url);
     ok_(__FILE__,line) (hres == (*exurl ? S_OK : S_FALSE), "get_LocationURL failed: %08x\n", hres);
-    ok_(__FILE__,line) (!strcmp_wa(url, exurl), "unexpected URL: %s\n", wine_dbgstr_w(url));
+    if (hres == S_OK)
+    {
+        ok_(__FILE__,line) (!strcmp_wa(url, exurl), "unexpected URL: %s\n", wine_dbgstr_w(url));
+        SysFreeString(url);
+    }
 
-    SysFreeString(url);
     IWebBrowser2_Release(wb);
 }
 
-- 
1.7.5.4




More information about the wine-patches mailing list