summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkoptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/config/mkoptions.c')
-rw-r--r--usr.sbin/config/mkoptions.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/usr.sbin/config/mkoptions.c b/usr.sbin/config/mkoptions.c
index c4bd624..5cd9d61 100644
--- a/usr.sbin/config/mkoptions.c
+++ b/usr.sbin/config/mkoptions.c
@@ -70,6 +70,8 @@ options(void)
/* Fake the cpu types as options. */
SLIST_FOREACH(cp, &cputype, cpu_next) {
op = (struct opt *)calloc(1, sizeof(*op));
+ if (op == NULL)
+ err(EXIT_FAILURE, "calloc");
op->op_name = ns(cp->cpu_name);
SLIST_INSERT_HEAD(&opt, op, op_next);
}
@@ -84,6 +86,8 @@ options(void)
/* Fake MAXUSERS as an option. */
op = (struct opt *)calloc(1, sizeof(*op));
+ if (op == NULL)
+ err(EXIT_FAILURE, "calloc");
op->op_name = ns("MAXUSERS");
snprintf(buf, sizeof(buf), "%d", maxusers);
op->op_value = ns(buf);
@@ -199,6 +203,8 @@ do_option(char *name)
tidy++;
} else {
op = (struct opt *) calloc(1, sizeof *op);
+ if (op == NULL)
+ err(EXIT_FAILURE, "calloc");
op->op_name = inw;
op->op_value = invalue;
SLIST_INSERT_HEAD(&op_head, op, op_next);
@@ -225,6 +231,8 @@ do_option(char *name)
if (value && !seen) {
/* New option appears */
op = (struct opt *) calloc(1, sizeof *op);
+ if (op == NULL)
+ err(EXIT_FAILURE, "calloc");
op->op_name = ns(name);
op->op_value = value ? ns(value) : NULL;
SLIST_INSERT_HEAD(&op_head, op, op_next);
@@ -336,6 +344,8 @@ next:
}
po = (struct opt_list *) calloc(1, sizeof *po);
+ if (po == NULL)
+ err(EXIT_FAILURE, "calloc");
po->o_name = this;
po->o_file = val;
SLIST_INSERT_HEAD(&otab, po, o_next);
OpenPOWER on IntegriCloud