diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index 77bcd2da0eee..774f36bd0eeb 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -479,8 +479,7 @@ rmopt_schedule(struct opt_head *list, char *name) { struct opt *op; - op = findopt(list, name); - if (op != NULL) { + while ((op = findopt(list, name)) != NULL) { SLIST_REMOVE(list, op, opt, op_next); free(op->op_name); free(op);