+struct ubus_object *ubusd_create_object_internal(struct ubus_object_type *type, uint32_t id)
+{
+ struct ubus_object *obj;
+
+ obj = calloc(1, sizeof(*obj));
+ if (!obj)
+ return NULL;
+
+ if (!ubus_alloc_id(&objects, &obj->id, id))
+ goto error_free;
+
+ obj->type = type;
+ INIT_LIST_HEAD(&obj->list);
+ INIT_LIST_HEAD(&obj->events);
+ if (type)
+ type->refcount++;
+
+ return obj;
+
+error_free:
+ free(obj);
+ return NULL;
+}
+