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

This commit is contained in:
Andrew Eikum 2011-04-27 09:12:43 -05:00 committed by Alexandre Julliard
parent 2692a68ce6
commit fc4748ae74
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
MODULE = winealsa.drv
IMPORTS = dxguid uuid winmm user32 advapi32
IMPORTS = dxguid uuid winmm ole32 user32 advapi32
EXTRALIBS = @ALSALIBS@
C_SRCS = \

View File

@ -271,7 +271,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
snd_pcm_close(This->pcm_handle);
HeapFree(GetProcessHeap(), 0, This->local_buffer);
HeapFree(GetProcessHeap(), 0, This->hw_params);
HeapFree(GetProcessHeap(), 0, This->fmt);
CoTaskMemFree(This->fmt);
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
@ -321,7 +321,7 @@ static WAVEFORMATEX *clone_format(const WAVEFORMATEX *fmt)
else
size = sizeof(WAVEFORMATEX);
ret = HeapAlloc(GetProcessHeap(), 0, size);
ret = CoTaskMemAlloc(size);
if(!ret)
return NULL;
@ -850,7 +850,7 @@ exit:
HeapFree(GetProcessHeap(), 0, formats);
if(hr == S_OK || !out){
HeapFree(GetProcessHeap(), 0, closest);
CoTaskMemFree(closest);
if(out)
*out = NULL;
}else if(closest){