--- src/sys/kern/kern_sysctl.c 2004/05/10 10:51:31 1.17 +++ src/sys/kern/kern_sysctl.c 2005/02/05 23:04:28 1.18 @@ -429,10 +429,12 @@ sysctl_add_oid(struct sysctl_ctx_list *c oidp->oid_handler = handler; oidp->oid_kind = CTLFLAG_DYN | kind; if ((kind & CTLTYPE) == CTLTYPE_NODE) { + struct sysctl_oid_list *children; + /* Allocate space for children */ - SYSCTL_CHILDREN(oidp) = malloc(sizeof(struct sysctl_oid_list), - M_SYSCTLOID, M_WAITOK); - SLIST_INIT(SYSCTL_CHILDREN(oidp)); + children = malloc(sizeof(*children), M_SYSCTLOID, M_WAITOK); + SYSCTL_SET_CHILDREN(oidp, children); + SLIST_INIT(children); } else { oidp->oid_arg1 = arg1; oidp->oid_arg2 = arg2;