Commit d4c0bedd authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

winecoreaudio.drv: Properly allocate and free the WAVEFORMATEX returned by IsFormatSupported.

parent e3ff943e
......@@ -417,7 +417,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
if(This->aqueue)
AudioQueueDispose(This->aqueue, 1);
HeapFree(GetProcessHeap(), 0, This->public_buffer);
HeapFree(GetProcessHeap(), 0, This->fmt);
CoTaskMemFree(This->fmt);
IMMDevice_Release(This->parent);
HeapFree(GetProcessHeap(), 0, This);
}
......@@ -498,7 +498,7 @@ static WAVEFORMATEX *clone_format(const WAVEFORMATEX *fmt)
else
size = sizeof(WAVEFORMATEX);
ret = HeapAlloc(GetProcessHeap(), 0, size);
ret = CoTaskMemAlloc(size);
if(!ret)
return NULL;
......@@ -700,6 +700,8 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
if(!buf){
AudioQueueDispose(This->aqueue, 1);
This->aqueue = NULL;
CoTaskMemFree(This->fmt);
This->fmt = NULL;
OSSpinLockUnlock(&This->lock);
return E_OUTOFMEMORY;
}
......@@ -708,6 +710,8 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
if(sc != noErr){
AudioQueueDispose(This->aqueue, 1);
This->aqueue = NULL;
CoTaskMemFree(This->fmt);
This->fmt = NULL;
OSSpinLockUnlock(&This->lock);
WARN("Couldn't allocate buffer: %lx\n", sc);
return E_FAIL;
......
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