summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-09-12 16:37:15 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-09-12 16:37:15 +0000
commit5ef12c75e8a888e9df0b53386a47af892e243dde (patch)
tree4200812cb39d2fe04ad73838d72ffd709e424836 /sbin/pfctl
parent53401d8f3b45d1ac9b44a774dc4de001706f80a2 (diff)
check calloc() return value
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/parse.y6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index e7f01d07eb7..e266dafdb5c 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.30 2001/09/06 22:37:08 jasoni Exp $ */
+/* $OpenBSD: parse.y,v 1.31 2001/09/12 16:37:14 markus Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -360,6 +360,8 @@ address : STRING {
YYERROR;
}
$$ = calloc(1, sizeof(struct node_host));
+ if ($$ == NULL)
+ err(1, "address: calloc");
memcpy(&$$->addr, hp->h_addr, sizeof(u_int32_t));
}
| NUMBER '.' NUMBER '.' NUMBER '.' NUMBER {
@@ -370,6 +372,8 @@ address : STRING {
YYERROR;
}
$$ = calloc(1, sizeof(struct node_host));
+ if ($$ == NULL)
+ err(1, "address: calloc");
$$->addr = htonl(($1 << 24) | ($3 << 16) | ($5 << 8) | $7);
}
;