--- a/dlls/winealsa.drv/mmdevdrv.c+++ b/dlls/winealsa.drv/mmdevdrv.c> @@ -1310,17 +1313,14 @@ exit:
LeaveCriticalSection(&This->lock); HeapFree(GetProcessHeap(), 0, formats);
- if(hr == S_OK || !out){
CoTaskMemFree(closest);
if(out)
*out = NULL;
- }else if(closest){
- if(hr == S_FALSE && out) { closest->nBlockAlign = closest->nChannels * closest->wBitsPerSample / 8; closest->nAvgBytesPerSec = closest->nBlockAlign * closest->nSamplesPerSec; *out = closest;
- }
- } else
CoTaskMemFree(closest);
You are dereferencing 'closest' without checking if it's non-NULL. It can be NULL if control jumps to the 'exit' label for several cases. This only applies to winealsa; for wineoss there are no gotos.
Octavian