EXPORT_API screen_connector_watcher_evas_h screen_connector_watcher_evas_add(screen_connector_watcher_evas_ops *ops, void *data)
{
-
screen_connector_watcher_evas_h handle;
screen_connector_watcher_evas_ops *evas_ops;
screen_connector_watcher_ops *watcher_ops;
watcher_ops = (screen_connector_watcher_ops *)calloc(1, sizeof(screen_connector_watcher_ops));
+ if (watcher_ops == NULL) {
+ LOGE("watcher_ops calloc fail");
+ return NULL;
+ }
watcher_ops->added_cb = __watcher_added_cb;
watcher_ops->updated_cb = __watcher_update_cb;
watcher_ops->removed_cb = __watcher_removed_cb;
evas_ops = (screen_connector_watcher_evas_ops *)calloc(1, sizeof(screen_connector_watcher_evas_ops));
if (evas_ops == NULL) {
+ free(watcher_ops);
LOGE("evas_ops calloc fail");
return NULL;
}
handle = (screen_connector_watcher_evas_h)calloc(1, sizeof(struct _screen_connector_watcher_evas_h));
if (handle == NULL) {
LOGE("handle calloc fail");
+ free(watcher_ops);
free(evas_ops);
return NULL;
}
handle->watcher_h = screen_connector_watcher_add(watcher_ops, handle);
return handle;
-
}
static void __destroy_watcher_evas_handle(screen_connector_watcher_evas_h watcher_evas_h)