diff options
author | Garrett Brown <themagnificentmrb@gmail.com> | 2016-08-16 22:17:02 -0700 |
---|---|---|
committer | Garrett Brown <themagnificentmrb@gmail.com> | 2016-08-16 22:20:49 -0700 |
commit | 4fc59c5ec2f3c870eab668a4539f865a49d71fed (patch) | |
tree | 50fbe3d4ed39de54f8ff6e1173662de6404f235f | |
parent | fe8558d81c1511868c2a2b923aafabcb4827c064 (diff) |
Fix defect in CID 142067
Defect was:
*** CID 142067: Error handling issues (CHECKED_RETURN)
772 PeripheralBusType busType = device->GetBusType();
773
774 if (busType == PERIPHERAL_BUS_ADDON)
775 {
776 // If device is from an add-on, use that add-on
777 unsigned int index;
>>> CID 142067: Error handling issues (CHECKED_RETURN)
>>> Calling "SplitLocation" without checking return value (as is done elsewhere 4 out of 5 times).
778 addonBus->SplitLocation(device->Location(), addon, index);
779 }
780 else
781 {
782 // Otherwise, have the add-on bus find a suitable add-on
783 addonBus->GetAddonWithButtonMap(device, addon);
-rw-r--r-- | xbmc/peripherals/Peripherals.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xbmc/peripherals/Peripherals.cpp b/xbmc/peripherals/Peripherals.cpp index eae598d8e8..629846d6fd 100644 --- a/xbmc/peripherals/Peripherals.cpp +++ b/xbmc/peripherals/Peripherals.cpp @@ -774,8 +774,10 @@ PeripheralAddonPtr CPeripherals::GetAddon(const CPeripheral* device) if (busType == PERIPHERAL_BUS_ADDON) { // If device is from an add-on, use that add-on + PeripheralAddonPtr peripheralAddon; unsigned int index; - addonBus->SplitLocation(device->Location(), addon, index); + if (addonBus->SplitLocation(device->Location(), addon, index)) + addon = std::move(peripheralAddon); } else { |