Andrew Talbot wrote:
@@ -142,13 +142,12 @@ static INT find_joystick_devices(void) { CHAR device_name[MAX_PATH], *str; INT len;
int fd; len = sprintf(device_name, "%s%d", JOYDEV_NEW, i) + 1;
if ((fd = open(device_name, O_RDONLY)) < 0)
if (open(device_name, O_RDONLY) < 0) { len = sprintf(device_name, "%s%d", JOYDEV_OLD, i) + 1;
if ((fd = open(device_name, O_RDONLY)) < 0) continue;
if (open(device_name, O_RDONLY) < 0) continue; } if (!(str = HeapAlloc(GetProcessHeap(), 0, len))) break;
Again, this needs to be fixed in another way as fd is being leaked.
Robert Shearman wrote:
Again, this needs to be fixed in another way as fd is being leaked.
Thanks, again. I've sent a patch entitled "dinput: Fix handle leak" to replace this.