dinput: Added some missing free/close in disabled case (Coverity).

This commit is contained in:
Marcus Meissner 2012-09-02 15:01:27 +02:00 committed by Alexandre Julliard
parent 791bc1cb93
commit e10a658c0c

View File

@ -251,7 +251,13 @@ static void find_joydevs(void)
else
joydev.name = joydev.device;
if (device_disabled_registry(joydev.name)) continue;
if (device_disabled_registry(joydev.name)) {
close(fd);
HeapFree(GetProcessHeap(), 0, joydev.name);
if (joydev.name != joydev.device)
HeapFree(GetProcessHeap(), 0, joydev.device);
continue;
}
joydev.guid = DInput_Wine_Joystick_Base_GUID;
joydev.guid.Data3 += have_joydevs;