dmusic: Set the dsound pointer to NULL on an error path.

Spotted by Sebastian Lackner.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2017-05-11 11:05:51 +02:00 committed by Alexandre Julliard
parent 01c6b4fe64
commit 3b4909fd94
1 changed files with 3 additions and 1 deletions

View File

@ -298,8 +298,10 @@ static HRESULT WINAPI IDirectMusic8Impl_SetDirectSound(IDirectMusic8 *iface, IDi
return hr;
hr = IDirectSound_SetCooperativeLevel(This->dsound, hwnd ? hwnd : GetForegroundWindow(),
DSSCL_PRIORITY);
if (FAILED(hr))
if (FAILED(hr)) {
IDirectSound_Release(This->dsound);
This->dsound = NULL;
}
return hr;
}