cur_bus = cur_bus->next;
}
- if (false == sender_exist) {
+ if (true == sender_exist) {
+ cur_hd = bus->hdlist;
+ while (cur_hd) {
+ rsrc_handle = cur_hd->data;
+
+ if (rsrc_handle->handle == handle) {
+ ERR("resource handle(%u, %u) already exist", rsrc_handle->handle,
+ rsrc_handle->number);
+ _icd_dbus_client_list_unlock();
+ return IOTCON_ERROR_ALREADY;
+ }
+ cur_hd = cur_hd->next;
+ }
+ } else {
DBG("sender(%s) not exist. make new one.", sender);
new_bus = calloc(1, sizeof(icd_dbus_client_s));
bus = new_bus;
}
- cur_hd = bus->hdlist;
- while (cur_hd) {
- rsrc_handle = cur_hd->data;
-
- if (rsrc_handle->handle == handle) {
- ERR("resource handle(%u, %u) already exist", rsrc_handle->handle,
- rsrc_handle->number);
- _icd_dbus_client_list_unlock();
- return IOTCON_ERROR_ALREADY;
- }
-
- cur_hd = cur_hd->next;
- }
-
rsrc_handle = calloc(1, sizeof(icd_resource_handle_s));
if (NULL == rsrc_handle) {
ERR("calloc(handle) Fail(%d)", errno);
ic_dbus_complete_observer_start(object, invocation, observe_h, ret);
+ /* observe_h will be freed in _dbus_handle_observer_stop() */
return TRUE;
}
{
FN_CALL;
int type, ret;
- char *dup_key;
iotcon_value_h value, copied_val;
iotcon_list_h child_list, copied_list;
iotcon_repr_h child_repr, copied_repr;
return;
}
- dup_key = ic_utils_strdup(key);
- if (NULL == dup_key) {
- ERR("dupic_utils_strdup() Fail");
- return;
- }
-
- icl_obj_set_value(dest_repr, dup_key, copied_val);
+ icl_obj_set_value(dest_repr, key, copied_val);
break;
case IOTCON_TYPE_LIST:
ret = icl_value_get_list(src_val, &child_list);