[PATCH] dsound: check for NULL listener (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Oct 17 10:21:00 CDT 2009


Hi,

will happen on a creation failure.

Ciao, Marcus
---
 dlls/dsound/tests/ds3d8.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/dsound/tests/ds3d8.c b/dlls/dsound/tests/ds3d8.c
index 9dfdd31..8ad428d 100644
--- a/dlls/dsound/tests/ds3d8.c
+++ b/dlls/dsound/tests/ds3d8.c
@@ -767,9 +767,11 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
         }
 EXIT1:
         if (has_listener) {
-            ref=IDirectSound3DListener_Release(listener);
-            ok(ref==0,"IDirectSound3dListener_Release() listener has %d "
-               "references, should have 0\n",ref);
+            if (listener) {
+                ref=IDirectSound3DListener_Release(listener);
+                ok(ref==0,"IDirectSound3dListener_Release() listener has %d "
+                   "references, should have 0\n",ref);
+            }
         } else {
             ref=IDirectSoundBuffer_Release(primary);
             ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
-- 
1.5.6



More information about the wine-patches mailing list