Module: wine Branch: master Commit: 84fd6e629a05a87cf788cff8bf009fbc94a269e9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=84fd6e629a05a87cf788cff8bf...
Author: Michael Karcher wine@mkarcher.dialup.fu-berlin.de Date: Fri May 30 09:34:45 2008 +0200
dsound: Fix double free in dsound capture.
---
dlls/dsound/capture.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c index f445b4f..c9444a4 100644 --- a/dlls/dsound/capture.c +++ b/dlls/dsound/capture.c @@ -860,6 +860,12 @@ IDirectSoundCaptureBufferImpl_Release( LPDIRECTSOUNDCAPTUREBUFFER8 iface ) if (This->notify) IDirectSoundNotify_Release((LPDIRECTSOUNDNOTIFY)This->notify);
+ /* If driver manages its own buffer, IDsCaptureDriverBuffer_Release + should have freed the buffer. Prevent freeing it again in + IDirectSoundCaptureBufferImpl_Create */ + if (!(This->device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY)) + This->device->buffer = NULL; + HeapFree(GetProcessHeap(), 0, This->notifies); HeapFree( GetProcessHeap(), 0, This ); TRACE("(%p) released\n", This);