Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dbus] Handle missing mode setting gracefully. Fixes MER#1576
If usb mode setting is not present in usb-moded.ini and override is not specified in kernel command line, get_mode_setting() will return null. The handler for "get_config" D-Bus method call does not check the return value and using the null value triggers abort from sanity checks at libdbus. Attempting to pass NULL as string via D-Bus causes abort. Use MODE_UNDEFINED as fallback in case the setting value is not defined. Also remove potential memory leaks in the code used for determining the mode setting value and use correct function for releasing the resulting dynamically allocated string. Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
- Loading branch information