X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bt-service%2Fbt-service-proximity.c;h=dadf5e4be528115a167ad2fed6a366e550be9771;hb=a764f5c5491c182af34156e93e9f8b97ace46ed7;hp=ad1cf28364f78ed1abfef61679d403e04b3c501e;hpb=36fcc28373b2289d4dd0e972880c10e65027f73c;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/bt-service/bt-service-proximity.c b/bt-service/bt-service-proximity.c index ad1cf28..dadf5e4 100644 --- a/bt-service/bt-service-proximity.c +++ b/bt-service/bt-service-proximity.c @@ -83,9 +83,11 @@ int bt_set_proximity_property(bluetooth_device_address_t *device_address, _bt_convert_addr_type_to_string(address, device_address->addr); device_path = _bt_get_device_object_path(address); - retv_if(device_path == NULL, BLUETOOTH_ERROR_NOT_CONNECTED); - BT_INFO("device_path is created[%s]", device_path); + if (device_path == NULL) + return BLUETOOTH_ERROR_NOT_CONNECTED; + else + BT_INFO("device_path is created[%s]", device_path); value_str = _bt_convert_alert_level_to_string(alert_level); property_str = _bt_convert_property_to_string(property); @@ -101,12 +103,7 @@ int bt_set_proximity_property(bluetooth_device_address_t *device_address, device_path, BT_PROPERTIES_INTERFACE, NULL, NULL); g_free(device_path); - - if (proxy == NULL) { - g_free(property_str); - g_free(value_str); - return BLUETOOTH_ERROR_INTERNAL; - } + retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL); ret = g_dbus_proxy_call_sync(proxy, "Set", g_variant_new("(ssv)", BT_PROXIMITY_MONITOR_INTERFACE, property_str, g_variant_new("s", value_str)), @@ -151,9 +148,11 @@ int bt_get_proximity_property(bluetooth_device_address_t *device_address, _bt_convert_addr_type_to_string(address, device_address->addr); device_path = _bt_get_device_object_path(address); - retv_if(device_path == NULL, BLUETOOTH_ERROR_NOT_CONNECTED); - BT_INFO("device_path is created[%s]", device_path); + if (device_path == NULL) + return BLUETOOTH_ERROR_NOT_CONNECTED; + else + BT_INFO("device_path is created[%s]", device_path); property_str = _bt_convert_property_to_string(property); @@ -225,9 +224,11 @@ int bt_get_proximity_supported_services(bluetooth_device_address_t *device_addre _bt_convert_addr_type_to_string(address, device_address->addr); device_path = _bt_get_device_object_path(address); - retv_if(device_path == NULL, BLUETOOTH_ERROR_NOT_CONNECTED); - BT_INFO("device_path is created[%s]", device_path); + if (device_path == NULL) + return BLUETOOTH_ERROR_NOT_CONNECTED; + else + BT_INFO("device_path is created[%s]", device_path); proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE, NULL, BT_BLUEZ_NAME,