}
sz = json_object_array_length(jarray);
- if (sz == 0 ){
+ if (sz == 0) {
BT_ERR("Mesh: Element array length is 0");
return false;
}
return false;
/* Delete group address */
- if (!json_object_object_get_ex(jmodel, "sub-addr", &jgroups)) {
+ if (!json_object_object_get_ex(jmodel, "sub-addr", &jgroups))
return false;
- }
- if(!__mesh_del_sub_group(jgroups, group_addr))
+ if (!__mesh_del_sub_group(jgroups, group_addr))
return false;
/* Save */
if (!jmodel)
return false;
- /* Delete all roup address */
- if (!json_object_object_get_ex(jmodel, "sub-addr", &jgroups)) {
+ /* Delete all group address */
+ if (!json_object_object_get_ex(jmodel, "sub-addr", &jgroups))
return false;
- }
sz = json_object_array_length(jgroups);
BT_INFO("Mesh: Total sub-addr entry present is [%d]", sz);
- for (int i = sz - 1; i >= 0 ; --i) {
+ for (int i = sz - 1; i >= 0 ; --i)
json_object_array_del_idx(jgroups, i, 1);
- }
/* Save */
return __bt_mesh_save_configruation_file(cfg);
sz = read(fd, str, st.st_size);
if (sz != st.st_size) {
BT_ERR("Mesh: Failed to read configuration file [%s]", file_name);
+ close(fd);
g_free(str);
return NULL;
}