screen_connector_info_h cur_info;
LOGD("__aul_screen_viewer_cb pid: %d, surface_id: %d, appid: %s type %d", pid, surface_id, appid, event_type);
+
+ if (info == NULL) {
+ LOGE("Fail to alloc info");
+ return;
+ }
+
info->appid = strdup(appid);
+ if (info->appid == NULL) {
+ LOGE("Fail to alloc appid");
+ free(info);
+ return;
+ }
+
info->instance_id = strdup(instance_id);
+ if (info->instance_id == NULL) {
+ LOGE("Fail to alloc instance_id");
+ free(info->appid);
+ free(info);
+ return;
+ }
+
info->pid = pid;
info->surface_id = surface_id;
info->ops = watcher_h->ops;
static img_info_h __create_img_info(const char *appid, const char *instance_id, int pid)
{
img_info_h info = (img_info_h)calloc(1, sizeof(struct _img_info_h));
+ if (info == NULL) {
+ LOGE("Fail to calloc img info");
+ return NULL;
+ }
+
info->appid = strdup(appid);
+ if (info->appid == NULL) {
+ LOGE("Fail to strdup appid");
+ free(info);
+ return NULL;
+ }
+
info->instance_id = strdup(instance_id);
+ if (info->instance_id == NULL) {
+ LOGE("Fail to strdup appid");
+ free(info->appid);
+ free(info);
+ return NULL;
+ }
info->pid = pid;
+
return info;
}
info = g_hash_table_lookup(__img_info_table, instance_id);
if (info == NULL) {
info = __create_img_info(appid, instance_id, pid);
+ if (info == NULL)
+ return;
+
g_hash_table_insert(__img_info_table, strdup(instance_id), info);
}