struct event_source *ev;
struct ubus_object *obj;
struct blob_attr *attr[EVREG_LAST];
- char *pattern;
+ char *pattern, *name;
uint32_t id;
bool partial = false;
int len;
list_add(&ev->list, &obj->events);
ev->obj = obj;
ev->partial = partial;
- ev->avl.key = (void *) (ev + 1);
- strcpy(ev->avl.key, pattern);
+ name = (char *) (ev + 1);
+ strcpy(name, pattern);
+ ev->avl.key = name;
avl_insert(&patterns, &ev->avl);
return 0;
goto free;
if (avl_insert(&path, &obj->path) != 0) {
- free(obj->path.key);
+ free((void *) obj->path.key);
obj->path.key = NULL;
goto free;
}
if (obj->path.key) {
ubusd_send_obj_event(obj, false);
avl_delete(&path, &obj->path);
- free(obj->path.key);
+ free((void *) obj->path.key);
}
if (!list_empty(&obj->list))
list_del(&obj->list);