static int _icl_ioty_fill_oic_rep_payload_value_array(OCRepPayload *payload,
const char *key, struct icl_state_list_s *list)
{
- int i, len, ret;
+ int i, j, len, ret;
bool *b_arr;
double *d_arr;
char **str_arr;
}
for (node = list->list, i = 0; node; node = node->next, i++) {
state_arr[i] = OCRepPayloadCreate();
+ if (NULL == state_arr[i]) {
+ ERR("OCRepPayloadCreate() Fail");
+ free(state_arr);
+ return ret;
+ }
ret = _icl_ioty_fill_oic_rep_payload_value(state_arr[i],
((icl_val_state_s*)node->data)->state);
if (IOTCON_ERROR_NONE != ret) {
ERR("_icl_ioty_fill_oic_rep_payload_value() Fail(%d)", ret);
+ for (j = 0; j <= i; j++)
+ OCRepPayloadDestroy(state_arr[j]);
+ free(state_arr);
return ret;
}
}
}
}
-int icl_ioty_unset_device_info_changed_cb()
+void icl_ioty_unset_device_info_changed_cb()
{
int ret;
+
ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_DEVICE_NAME);
- WARN_IF(SYSTEM_SETTINGS_ERROR_NONE != ret, "system_settings_unset_changed_cb() Fail(%d)", ret);
+ WARN_IF(SYSTEM_SETTINGS_ERROR_NONE != ret,
+ "system_settings_unset_changed_cb() Fail(%d)", ret);
}
int icl_ioty_set_device_info()
int icl_ioty_set_device_info();
int icl_ioty_set_platform_info();
-int icl_ioty_unset_device_info_changed_cb();
+void icl_ioty_unset_device_info_changed_cb();
/* client APIs */
int icl_ioty_find_resource(const char *host_address,