Signed-off-by: Sven Baars sven.wine@gmail.com --- dlls/dinput/dinput_main.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index 7074704d7a..54777da2d9 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -1104,10 +1104,12 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
if (lpCallback(&didevis[i], lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP) { + IDirectInputDevice_Release(lpdid); HeapFree(GetProcessHeap(), 0, didevis); HeapFree(GetProcessHeap(), 0, username_w); return DI_OK; } + IDirectInputDevice_Release(lpdid); }
HeapFree(GetProcessHeap(), 0, didevis); @@ -1130,9 +1132,11 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
if (lpCallback(&didevi, lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP) { + IDirectInputDevice_Release(lpdid); HeapFree(GetProcessHeap(), 0, username_w); return DI_OK; } + IDirectInputDevice_Release(lpdid); } }