Andrew Eikum : dsound: Don't dereference a freed object.

Alexandre Julliard julliard at winehq.org
Wed Sep 21 13:35:16 CDT 2011


Module: wine
Branch: master
Commit: e2cc32d252c01f3b00ef02a2084a810a082ff0a9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e2cc32d252c01f3b00ef02a2084a810a082ff0a9

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Wed Sep 21 11:25:27 2011 -0500

dsound: Don't dereference a freed object.

---

 dlls/dsound/sound3d.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/dsound/sound3d.c b/dlls/dsound/sound3d.c
index a820c51..e64cd43 100644
--- a/dlls/dsound/sound3d.c
+++ b/dlls/dsound/sound3d.c
@@ -787,9 +787,9 @@ static ULONG WINAPI IDirectSound3DListenerImpl_Release(LPDIRECTSOUND3DLISTENER i
 
     if (!ref) {
         This->device->listener = 0;
-        HeapFree(GetProcessHeap(), 0, This);
         if (!InterlockedDecrement(&This->device->primary->numIfaces))
             primarybuffer_destroy(This->device->primary);
+        HeapFree(GetProcessHeap(), 0, This);
         TRACE("(%p) released\n", This);
     }
     return ref;




More information about the wine-cvs mailing list