[PATCH] skip pstgmed related tests if NULL

Marcus Meissner marcus at jet.franken.de
Wed Jan 16 13:03:58 CST 2008


Hi,

Spotted by Coverity, we use pstgmed even outside the if().
Fixed by just skipping the additional tests that use pstgmed.

Ciao, Marcus
---
 dlls/urlmon/tests/url.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/urlmon/tests/url.c b/dlls/urlmon/tests/url.c
index 8ac533a..91366aa 100644
--- a/dlls/urlmon/tests/url.c
+++ b/dlls/urlmon/tests/url.c
@@ -1283,11 +1283,13 @@ static HRESULT WINAPI statusclb_OnDataAvailable(IBindStatusCallback *iface, DWOR
     }
 
     ok(pstgmed != NULL, "stgmeg == NULL\n");
-    if(pstgmed) {
-        ok(pstgmed->tymed == TYMED_ISTREAM, "tymed=%u\n", pstgmed->tymed);
-        ok(U(*pstgmed).pstm != NULL, "pstm == NULL\n");
-        ok(pstgmed->pUnkForRelease != NULL, "pUnkForRelease == NULL\n");
+    if(!pstgmed) {
+	skip("further pstgmed related tests here.\n");
+	return S_OK;
     }
+    ok(pstgmed->tymed == TYMED_ISTREAM, "tymed=%u\n", pstgmed->tymed);
+    ok(U(*pstgmed).pstm != NULL, "pstm == NULL\n");
+    ok(pstgmed->pUnkForRelease != NULL, "pUnkForRelease == NULL\n");
 
     if(grfBSCF & BSCF_FIRSTDATANOTIFICATION) {
         hres = IStream_Write(U(*pstgmed).pstm, buf, 10, NULL);
-- 
1.5.2.4



More information about the wine-patches mailing list