lua: Fix stack imbalance in ubus_event_handler
[project/ubus.git] / ubusd_acl.c
index 3c16114..491b233 100644 (file)
@@ -100,11 +100,11 @@ ubusd_acl_check(struct ubus_client *cl, const char *obj,
        struct blob_attr *cur;
        int rem;
 
-       if (!cl->gid && !cl->gid)
+       if (!cl->gid && !cl->uid)
                return 0;
 
        acl = avl_find_ge_element(&ubusd_acls, obj, acl, avl);
-       while (acl && !avl_is_last(&ubusd_acls, &acl->avl)) {
+       while (acl) {
                int diff = ubusd_acl_match_path(obj, acl->avl.key, NULL);
 
                if (diff)
@@ -206,7 +206,7 @@ ubusd_acl_alloc_obj(struct ubusd_acl_file *file, const char *obj)
        struct ubusd_acl_obj *o;
        char *k;
 
-       o = calloc_a(1, sizeof(*o), &k, strlen(obj) + 1);
+       o = calloc_a(sizeof(*o), &k, strlen(obj) + 1);
        o->user = file->user;
        o->group = file->group;
        o->avl.key = k;