char name[255] = {0, };
unsigned int i, cnt = 0;
- if (!full_path) return;
+ if (!full_path) {
+ VC_ELM_LOG_ERR("[ERROR] full_path is NULL");
+ return;
+ }
+ if (!object_info) {
+ VC_ELM_LOG_ERR("[ERROR] object_info is NULL");
+ return;
+ }
for (i = 0; i < strlen(full_path); i++) {
if (full_path[i] == '/') {
}
name[cnt] = '\0';
object_info->edje_file = calloc(1, strlen(name) + 1);
+ if (!object_info->edje_file) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->edje_file, name, strlen(name) + 1);
}
// evas object type check
if (evas_object_is_swallow_rect(obj)) {
object_info->type = calloc(1, strlen("swallow") + 1);
+ if (!object_info->type) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->type, "swallow", strlen("swallow") + 1);
} else if (evas_object_type_match(obj, "rectangle")) {
object_info->type = calloc(1, strlen("rect") + 1);
+ if (!object_info->type) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->type, "rect", strlen("rect") + 1);
evas_object_color_get(obj, &r, &g, &b, &a);
object_info->rgb_info.r = r;
object_info->rgb_info.a = a;
} else {
object_info->type = calloc(1, strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
+ if (!object_info->type) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->type, EVAS_OBJECT_TYPE_GET(obj), strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
}
edje_object_file_get(obj, &file, &group);
if (group) {
object_info->group = calloc(1, strlen(group) + 1);
+ if (!object_info->group) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->group, group, strlen(group) + 1);
}
if (edje_info->obj == obj) {
if (edje_info->color_class) {
object_info->color_class = calloc(1, strlen(edje_info->color_class) + 1);
+ if (!object_info->color_class) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->color_class, edje_info->color_class, strlen(edje_info->color_class) + 1);
}
ret = edje_object_part_state_get(evas_object_smart_parent_get(obj), edje_info->part_name, &val);
object_info->part_name = calloc(1, strlen(edje_info->part_name) + 1);
object_info->part_state = calloc(1, strlen(ret) + 1);
+ if (!object_info->part_name || !object_info->part_state) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->part_name, edje_info->part_name, strlen(edje_info->part_name) + 1);
strncpy(object_info->part_state, ret, strlen(ret) + 1);
if (edje_info->image_name) {
object_info->image_name = calloc(1, strlen(edje_info->image_name) + 1);
+ if (!object_info->image_name) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->image_name, edje_info->image_name, strlen(edje_info->image_name) + 1);
}
break;
}
if (text && strlen(text) > 0) {
object_info->text = calloc(1, strlen(text) + 1);
+ if (!object_info->text) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->text, text, strlen(text) + 1);
}
// evas object type check
if (evas_object_is_swallow_rect(obj)) {
object_info->type = calloc(1, strlen("swallow") + 1);
+ if (!object_info->type) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->type, "swallow", strlen("swallow") + 1);
} else if (evas_object_type_match(obj, "rectangle")) {
object_info->type = calloc(1, strlen("rect") + 1);
+ if (!object_info->type) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->type, "rect", strlen("rect") + 1);
evas_object_color_get(obj, &r, &g, &b, &a);
object_info->rgb_info.r = r;
object_info->rgb_info.a = a;
} else {
object_info->type = calloc(1, strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
+ if (!object_info->type) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->type, EVAS_OBJECT_TYPE_GET(obj), strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
}
edje_object_file_get(obj, &file, &group);
if (group) {
object_info->group = calloc(1, strlen(group) + 1);
+ if (!object_info->group) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->group, group, strlen(group) + 1);
}
if (edje_info->obj == obj) {
if (edje_info->color_class) {
object_info->color_class = calloc(1, strlen(edje_info->color_class) + 1);
+ if (!object_info->color_class) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->color_class, edje_info->color_class, strlen(edje_info->color_class) + 1);
}
ret = edje_object_part_state_get(evas_object_smart_parent_get(obj), edje_info->part_name, &val);
object_info->part_name = calloc(1, strlen(edje_info->part_name) + 1);
object_info->part_state = calloc(1, strlen(ret) + 1);
+ if (!object_info->part_name || !object_info->part_state) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->part_name, edje_info->part_name, strlen(edje_info->part_name) + 1);
strncpy(object_info->part_state, ret, strlen(ret) + 1);
if (edje_info->image_name) {
object_info->image_name = calloc(1, strlen(edje_info->image_name) + 1);
+ if (!object_info->image_name) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->image_name, edje_info->image_name, strlen(edje_info->image_name) + 1);
}
break;
}
if (text && strlen(text) > 0) {
object_info->text = calloc(1, strlen(text) + 1);
+ if (!object_info->text) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
strncpy(object_info->text, text, strlen(text) + 1);
}