Commit 164a4070 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dsound: Avoid using pointer value after free.

parent e2f7f01a
...@@ -1192,9 +1192,9 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This) ...@@ -1192,9 +1192,9 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This)
HeapFree(GetProcessHeap(), 0, This->filters); HeapFree(GetProcessHeap(), 0, This->filters);
} }
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This); TRACE("(%p) released\n", This);
HeapFree(GetProcessHeap(), 0, This);
} }
BOOL secondarybuffer_is_audible(IDirectSoundBufferImpl *This) BOOL secondarybuffer_is_audible(IDirectSoundBufferImpl *This)
......
...@@ -109,8 +109,8 @@ static void capturebuffer_destroy(IDirectSoundCaptureBufferImpl *This) ...@@ -109,8 +109,8 @@ static void capturebuffer_destroy(IDirectSoundCaptureBufferImpl *This)
This->device->capture_buffer = NULL; This->device->capture_buffer = NULL;
HeapFree(GetProcessHeap(), 0, This->notifies); HeapFree(GetProcessHeap(), 0, This->notifies);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This); TRACE("(%p) released\n", This);
HeapFree(GetProcessHeap(), 0, This);
} }
/******************************************************************************* /*******************************************************************************
...@@ -871,8 +871,8 @@ static ULONG DirectSoundCaptureDevice_Release( ...@@ -871,8 +871,8 @@ static ULONG DirectSoundCaptureDevice_Release(
HeapFree(GetProcessHeap(), 0, device->pwfx); HeapFree(GetProcessHeap(), 0, device->pwfx);
device->lock.DebugInfo->Spare[0] = 0; device->lock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &(device->lock) ); DeleteCriticalSection( &(device->lock) );
TRACE("(%p) released\n", device);
HeapFree(GetProcessHeap(), 0, device); HeapFree(GetProcessHeap(), 0, device);
TRACE("(%p) released\n", device);
} }
return ref; return ref;
} }
...@@ -1099,8 +1099,8 @@ static void capture_destroy(IDirectSoundCaptureImpl *This) ...@@ -1099,8 +1099,8 @@ static void capture_destroy(IDirectSoundCaptureImpl *This)
{ {
if (This->device) if (This->device)
DirectSoundCaptureDevice_Release(This->device); DirectSoundCaptureDevice_Release(This->device);
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n", This); TRACE("(%p) released\n", This);
HeapFree(GetProcessHeap(),0,This);
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -239,8 +239,8 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device) ...@@ -239,8 +239,8 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
HeapFree(GetProcessHeap(), 0, device->buffer); HeapFree(GetProcessHeap(), 0, device->buffer);
device->mixlock.DebugInfo->Spare[0] = 0; device->mixlock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&device->mixlock); DeleteCriticalSection(&device->mixlock);
HeapFree(GetProcessHeap(),0,device);
TRACE("(%p) released\n", device); TRACE("(%p) released\n", device);
HeapFree(GetProcessHeap(),0,device);
} }
return ref; return ref;
} }
...@@ -670,8 +670,8 @@ static void directsound_destroy(IDirectSoundImpl *This) ...@@ -670,8 +670,8 @@ static void directsound_destroy(IDirectSoundImpl *This)
{ {
if (This->device) if (This->device)
DirectSoundDevice_Release(This->device); DirectSoundDevice_Release(This->device);
HeapFree(GetProcessHeap(),0,This);
TRACE("(%p) released\n", This); TRACE("(%p) released\n", This);
HeapFree(GetProcessHeap(),0,This);
} }
static inline IDirectSoundImpl *impl_from_IUnknown(IUnknown *iface) static inline IDirectSoundImpl *impl_from_IUnknown(IUnknown *iface)
......
...@@ -61,8 +61,8 @@ static void fullduplex_destroy(IDirectSoundFullDuplexImpl *This) ...@@ -61,8 +61,8 @@ static void fullduplex_destroy(IDirectSoundFullDuplexImpl *This)
while(IDirectSoundCapture_Release(dsc8) > 0); while(IDirectSoundCapture_Release(dsc8) > 0);
IUnknown_Release(This->dsc8_unk); IUnknown_Release(This->dsc8_unk);
} }
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This); TRACE("(%p) released\n", This);
HeapFree(GetProcessHeap(), 0, This);
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -91,8 +91,8 @@ static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface) ...@@ -91,8 +91,8 @@ static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface)
TRACE("(%p) ref %ld\n", This, ref); TRACE("(%p) ref %ld\n", This, ref);
if (!ref) { if (!ref) {
TRACE("(%p) released\n", This);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
} }
return ref; return ref;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment