summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2003-01-10 08:03:28 +0000
committerhenning <henning@openbsd.org>2003-01-10 08:03:28 +0000
commit4aa936e84590ab6a8ff471e032fa136b9147cc46 (patch)
tree78b2a233be771e150ffef80c94a302a907052ecc
parentprint queue length for PRIQ, works now (diff)
downloadwireguard-openbsd-4aa936e84590ab6a8ff471e032fa136b9147cc46.tar.xz
wireguard-openbsd-4aa936e84590ab6a8ff471e032fa136b9147cc46.zip
no return after err(3), errx -> err after calloc failure
andrushock at korovino.net via dhartmei@
-rw-r--r--sbin/pfctl/pfctl_qstats.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sbin/pfctl/pfctl_qstats.c b/sbin/pfctl/pfctl_qstats.c
index 10beb6e7085..1bb690de29c 100644
--- a/sbin/pfctl/pfctl_qstats.c
+++ b/sbin/pfctl/pfctl_qstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_qstats.c,v 1.6 2003/01/10 08:00:23 henning Exp $ */
+/* $OpenBSD: pfctl_qstats.c,v 1.7 2003/01/10 08:03:28 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer
@@ -151,10 +151,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));
memcpy(&node->qstats, &qstats, sizeof(qstats));
node->next = node->children = NULL;
@@ -171,10 +169,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 {
@@ -276,7 +272,6 @@ print_priqstats(struct priq_classstats qstats)
qstats.qlength, qstats.qlimit);
}
-
void
pfctl_free_altq_node(struct pf_altq_node *node)
{