summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcpd/options.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2010-01-02 04:21:16 +0000
committerkrw <krw@openbsd.org>2010-01-02 04:21:16 +0000
commitd60fc4a49ba5bfd05a3b09e715a328032ca8a26c (patch)
tree4f19ae42780699a1e61c5605aae297d2b13c6448 /usr.sbin/dhcpd/options.c
parentcomplete the sync to 1.9.15-pre2: mostly minor fixes (diff)
downloadwireguard-openbsd-d60fc4a49ba5bfd05a3b09e715a328032ca8a26c.tar.xz
wireguard-openbsd-d60fc4a49ba5bfd05a3b09e715a328032ca8a26c.zip
Eliminate all uses of dmalloc() where the returned pointer
is checked for NULL and a specific error/warning issued. Add two such manual warning/error checks and kill those dmalloc calls. And then there were none, so kill dmalloc(). Whew.
Diffstat (limited to 'usr.sbin/dhcpd/options.c')
-rw-r--r--usr.sbin/dhcpd/options.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/dhcpd/options.c b/usr.sbin/dhcpd/options.c
index 4f008fb3cae..a42c688e466 100644
--- a/usr.sbin/dhcpd/options.c
+++ b/usr.sbin/dhcpd/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.25 2010/01/01 20:46:20 krw Exp $ */
+/* $OpenBSD: options.c,v 1.26 2010/01/02 04:21:16 krw Exp $ */
/* DHCP options parsing and reassembly. */
@@ -159,7 +159,8 @@ parse_option_buffer(struct packet *packet,
* space for it and copy it there.
*/
if (!packet->options[code].data) {
- if (!(t = dmalloc(len + 1, "parse_option_buffer")))
+ t = calloc(1, len + 1);
+ if (!t)
error("Can't allocate storage for option %s.",
dhcp_options[code].name);
/*
@@ -176,8 +177,7 @@ parse_option_buffer(struct packet *packet,
* we last saw. This is really only required
* for clients, but what the heck...
*/
- t = dmalloc(len + packet->options[code].len + 1,
- "parse_option_buffer");
+ t = calloc(1, len + packet->options[code].len + 1);
if (!t)
error("Can't expand storage for option %s.",
dhcp_options[code].name);