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

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

parent 2692a68c
MODULE = winealsa.drv MODULE = winealsa.drv
IMPORTS = dxguid uuid winmm user32 advapi32 IMPORTS = dxguid uuid winmm ole32 user32 advapi32
EXTRALIBS = @ALSALIBS@ EXTRALIBS = @ALSALIBS@
C_SRCS = \ C_SRCS = \
......
...@@ -271,7 +271,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface) ...@@ -271,7 +271,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
snd_pcm_close(This->pcm_handle); snd_pcm_close(This->pcm_handle);
HeapFree(GetProcessHeap(), 0, This->local_buffer); HeapFree(GetProcessHeap(), 0, This->local_buffer);
HeapFree(GetProcessHeap(), 0, This->hw_params); HeapFree(GetProcessHeap(), 0, This->hw_params);
HeapFree(GetProcessHeap(), 0, This->fmt); CoTaskMemFree(This->fmt);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
} }
return ref; return ref;
...@@ -321,7 +321,7 @@ static WAVEFORMATEX *clone_format(const WAVEFORMATEX *fmt) ...@@ -321,7 +321,7 @@ static WAVEFORMATEX *clone_format(const WAVEFORMATEX *fmt)
else else
size = sizeof(WAVEFORMATEX); size = sizeof(WAVEFORMATEX);
ret = HeapAlloc(GetProcessHeap(), 0, size); ret = CoTaskMemAlloc(size);
if(!ret) if(!ret)
return NULL; return NULL;
...@@ -850,7 +850,7 @@ exit: ...@@ -850,7 +850,7 @@ exit:
HeapFree(GetProcessHeap(), 0, formats); HeapFree(GetProcessHeap(), 0, formats);
if(hr == S_OK || !out){ if(hr == S_OK || !out){
HeapFree(GetProcessHeap(), 0, closest); CoTaskMemFree(closest);
if(out) if(out)
*out = NULL; *out = NULL;
}else if(closest){ }else if(closest){
......
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