projects
/
project
/
ubus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix SIGINT handling
[project/ubus.git]
/
ubusd_obj.c
diff --git
a/ubusd_obj.c
b/ubusd_obj.c
index
a6be182
..
ffd5330
100644
(file)
--- a/
ubusd_obj.c
+++ b/
ubusd_obj.c
@@
-98,6
+98,7
@@
struct ubus_object *ubusd_create_object_internal(struct ubus_object_type *type,
obj->type = type;
INIT_LIST_HEAD(&obj->list);
obj->type = type;
INIT_LIST_HEAD(&obj->list);
+ INIT_LIST_HEAD(&obj->events);
if (type)
type->refcount++;
if (type)
type->refcount++;
@@
-118,11
+119,12
@@
struct ubus_object *ubusd_create_object(struct ubus_client *cl, struct blob_attr
else if (attr[UBUS_ATTR_SIGNATURE])
type = ubus_create_obj_type(attr[UBUS_ATTR_SIGNATURE]);
else if (attr[UBUS_ATTR_SIGNATURE])
type = ubus_create_obj_type(attr[UBUS_ATTR_SIGNATURE]);
- if (!
type
)
+ if (!
!type ^ !!attr[UBUS_ATTR_OBJPATH]
)
return NULL;
obj = ubusd_create_object_internal(type, 0);
return NULL;
obj = ubusd_create_object_internal(type, 0);
- ubus_unref_object_type(type);
+ if (type)
+ ubus_unref_object_type(type);
if (!obj)
return NULL;
if (!obj)
return NULL;
@@
-141,6
+143,7
@@
struct ubus_object *ubusd_create_object(struct ubus_client *cl, struct blob_attr
obj->client = cl;
list_add(&obj->list, &cl->objects);
obj->client = cl;
list_add(&obj->list, &cl->objects);
+
return obj;
free:
return obj;
free:
@@
-150,6
+153,7
@@
free:
void ubusd_free_object(struct ubus_object *obj)
{
void ubusd_free_object(struct ubus_object *obj)
{
+ ubusd_event_cleanup_object(obj);
if (obj->path.key) {
avl_delete(&path, &obj->path);
free(obj->path.key);
if (obj->path.key) {
avl_delete(&path, &obj->path);
free(obj->path.key);