X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=ubusd_obj.c;h=dd44882e08d57e44ea983a1fdbbed58897204757;hb=c5f2053dfcfd1b81a3d29cdd27b26751b96e1acd;hp=0c9cb9ae820815da7597a40ec6e803aaad2e9c2b;hpb=72be8e93f07d0dfb1f42edfbdb93ea04311dcb5a;p=project%2Fubus.git diff --git a/ubusd_obj.c b/ubusd_obj.c index 0c9cb9a..dd44882 100644 --- a/ubusd_obj.c +++ b/ubusd_obj.c @@ -20,13 +20,12 @@ struct avl_tree path; static void ubus_unref_object_type(struct ubus_object_type *type) { - struct ubus_method *m; + struct ubus_method *m, *tmp; if (--type->refcount > 0) return; - while (!list_empty(&type->methods)) { - m = list_first_entry(&type->methods, struct ubus_method, list); + list_for_each_entry_safe(m, tmp, &type->methods, list) { list_del(&m->list); free(m); }