summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-01-05 02:17:10 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-01-05 02:17:10 +0000
commit5bbdeb97d08a6dd5b67c23d2f3c76d081d3bd360 (patch)
treeea0077889ecddeb9797db4feeb8c6fcae883dcbc
parent400fd05c022e1b49a90688571cca0a0279d98b29 (diff)
err()/errx() do not return, errx() -> err() after calloc(), it sets errno.
From Andrey Matveev.
-rw-r--r--sbin/pfctl/pfctl_altq.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
index bd6b28e1d2a..73e53532c03 100644
--- a/sbin/pfctl/pfctl_altq.c
+++ b/sbin/pfctl/pfctl_altq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_altq.c,v 1.29 2003/01/04 00:01:34 deraadt Exp $ */
+/* $OpenBSD: pfctl_altq.c,v 1.30 2003/01/05 02:17:09 dhartmei Exp $ */
/*
* Copyright (C) 2002
@@ -1010,10 +1010,8 @@ pfctl_insert_altq_node(struct pf_altq_node **root,
struct pf_altq_node *node;
node = calloc(1, sizeof(struct pf_altq_node));
- if (node == NULL) {
- errx(1, "pfctl_insert_altq_node: calloc");
- return;
- }
+ if (node == NULL)
+ err(1, "pfctl_insert_altq_node: calloc");
memcpy(&node->altq, &altq, sizeof(struct pf_altq));
node->next = node->children = NULL;
@@ -1029,10 +1027,8 @@ pfctl_insert_altq_node(struct pf_altq_node **root,
struct pf_altq_node *parent;
parent = pfctl_find_altq_node(*root, altq.parent, altq.ifname);
- if (parent == NULL) {
+ if (parent == NULL)
errx(1, "parent %s not found", altq.parent);
- return;
- }
if (parent->children == NULL)
parent->children = node;
else {