diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-07-06 06:24:46 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-07-06 06:58:06 +0200 |
commit | 0612430277f4cfb38b9c1eb0d5471e4bdbe1db00 (patch) | |
tree | e0206687765c4ca26836b59fe1b883ee46a17665 /sd/source | |
parent | f914d63ef46ccc4f62228edc394353948a1a3da4 (diff) |
coverity#1202762: Unchecked return value
Change-Id: Ic69a6507df5444175b6aba4de01ca94d9a28be09
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/remotecontrol/BluetoothServer.cxx | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index ea99e0c7b09c..7d586ca433e8 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -769,22 +769,27 @@ setDBusBooleanProperty( DBusConnection *pConnection, DBusObject *pAdapter, DBusMessage *pMsg = pProperties->getMethodCall( "Set" ); DBusMessageIter itIn; - dbus_message_iter_init_append( pMsg, &itIn ); - const char* pInterface = "org.bluez.Adapter1"; - dbus_message_iter_append_basic( &itIn, DBUS_TYPE_STRING, &pInterface ); - dbus_message_iter_append_basic( &itIn, DBUS_TYPE_STRING, &pPropertyName ); - + if(!dbus_message_iter_init_append( pMsg, &itIn )) { - DBusMessageIter varIt; - dbus_message_iter_open_container( &itIn, DBUS_TYPE_VARIANT, - DBUS_TYPE_BOOLEAN_AS_STRING, &varIt ); - dbus_bool_t bDBusBoolean = bBoolean; - dbus_message_iter_append_basic( &varIt, DBUS_TYPE_BOOLEAN, &bDBusBoolean ); - dbus_message_iter_close_container( &itIn, &varIt ); + SAL_WARN( "sdremote.bluetooth", "error init dbus" ); } + else + { + const char* pInterface = "org.bluez.Adapter1"; + dbus_message_iter_append_basic( &itIn, DBUS_TYPE_STRING, &pInterface ); + dbus_message_iter_append_basic( &itIn, DBUS_TYPE_STRING, &pPropertyName ); - pMsg = sendUnrefAndWaitForReply( pConnection, pMsg ); + { + DBusMessageIter varIt; + dbus_message_iter_open_container( &itIn, DBUS_TYPE_VARIANT, + DBUS_TYPE_BOOLEAN_AS_STRING, &varIt ); + dbus_bool_t bDBusBoolean = bBoolean; + dbus_message_iter_append_basic( &varIt, DBUS_TYPE_BOOLEAN, &bDBusBoolean ); + dbus_message_iter_close_container( &itIn, &varIt ); + } + pMsg = sendUnrefAndWaitForReply( pConnection, pMsg ); + } if( !pMsg ) { SAL_WARN( "sdremote.bluetooth", "no valid reply / timeout" ); |