{
int ret;
const char *widget_id;
+ char *buf;
char *comp_id;
char *tmp = NULL;
return ret;
} else {
/* widget component */
- comp_id = strtok_r(strdup(widget_id), "@", &tmp);
- if (!comp_id) {
+ buf = strdup(widget_id);
+ if (!buf) {
_E("out of memory");
return -1;
}
-
+ comp_id = strtok_r(buf, "@", &tmp);
+ if (!comp_id) {
+ _E("Failed to get component id %s", widget_id);
+ free(buf);
+ return -1;
+ }
*is_widget_component = true;
handle->instance_id = bundle_get_val(kb,
AUL_K_WIDGET_INSTANCE_ID);
bundle_add_str(kb, AUL_K_COMPONENT_ID, comp_id);
bundle_add_str(kb, AUL_K_INSTANCE_ID,
handle->instance_id);
- free(comp_id);
+ free(buf);
handle->comp_id = bundle_get_val(kb, AUL_K_COMPONENT_ID);
}
}