* Don't leak the decoded instructions in case the device object cannot be
allocated. * Remove accidentally added debug device id. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27461 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8008c36e34
commit
b57520d4a9
@ -181,20 +181,21 @@ HIDDevice::MakeHIDDevice(usb_device device,
|
||||
}
|
||||
|
||||
// determine device type and create the device object
|
||||
HIDDevice *hidDevice = NULL;
|
||||
if (deviceType == USB_HID_DEVICE_TYPE_KEYBOARD) {
|
||||
return new(std::nothrow) KeyboardDevice(device, interruptPipe,
|
||||
hidDevice = new(std::nothrow) KeyboardDevice(device, interruptPipe,
|
||||
interfaceIndex, finalInstructions, instructionCount,
|
||||
totalReportSize);
|
||||
} else if (deviceType == USB_HID_DEVICE_TYPE_MOUSE
|
||||
|| deviceType == 0x01250015) {
|
||||
return new(std::nothrow) MouseDevice(device, interruptPipe,
|
||||
} else if (deviceType == USB_HID_DEVICE_TYPE_MOUSE) {
|
||||
hidDevice = new(std::nothrow) MouseDevice(device, interruptPipe,
|
||||
interfaceIndex, finalInstructions, instructionCount,
|
||||
totalReportSize);
|
||||
}
|
||||
} else
|
||||
TRACE_ALWAYS("unsupported device type 0x%08lx\n", deviceType);
|
||||
|
||||
TRACE_ALWAYS("unsupported device type 0x%08lx\n", deviceType);
|
||||
free(finalInstructions);
|
||||
return NULL;
|
||||
if (hidDevice == NULL)
|
||||
free(finalInstructions);
|
||||
return hidDevice;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user