diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-20 22:39:31 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-20 22:39:31 +0000 |
commit | aa0cb4643fc13729e7874a5eb16e9eecd90c1ced (patch) | |
tree | 1b6337f56b8a55bfda6bab69525fe62675d14e0e /usr.sbin/dhcpd | |
parent | 6e5d9523d6273368df6377a4db98a9533d11505c (diff) |
stdlib.h is in scope; do not cast malloc/calloc/realloc*
ok millert krw
Diffstat (limited to 'usr.sbin/dhcpd')
-rw-r--r-- | usr.sbin/dhcpd/confpars.c | 5 | ||||
-rw-r--r-- | usr.sbin/dhcpd/dhcp.c | 4 | ||||
-rw-r--r-- | usr.sbin/dhcpd/dispatch.c | 8 |
3 files changed, 8 insertions, 9 deletions
diff --git a/usr.sbin/dhcpd/confpars.c b/usr.sbin/dhcpd/confpars.c index 8b79d263a80..2423e91dba1 100644 --- a/usr.sbin/dhcpd/confpars.c +++ b/usr.sbin/dhcpd/confpars.c @@ -1,4 +1,4 @@ -/* $OpenBSD: confpars.c,v 1.24 2015/05/18 17:51:21 krw Exp $ */ +/* $OpenBSD: confpars.c,v 1.25 2015/08/20 22:39:29 deraadt Exp $ */ /* * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. @@ -1277,8 +1277,7 @@ parse_lease_declaration(FILE *cfile) if (token == TOK_STRING) { token = next_token(&val, cfile); lease.uid_len = strlen(val); - lease.uid = (unsigned char *) - malloc(lease.uid_len); + lease.uid = malloc(lease.uid_len); if (!lease.uid) { warning("no space for uid"); return NULL; diff --git a/usr.sbin/dhcpd/dhcp.c b/usr.sbin/dhcpd/dhcp.c index 9edcd55dda2..f90aa4a3983 100644 --- a/usr.sbin/dhcpd/dhcp.c +++ b/usr.sbin/dhcpd/dhcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcp.c,v 1.42 2015/04/15 12:40:57 krw Exp $ */ +/* $OpenBSD: dhcp.c,v 1.43 2015/08/20 22:39:29 deraadt Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998, 1999 @@ -874,7 +874,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, lt.uid_len = packet->options[i].len; } else { lt.uid_max = lt.uid_len = packet->options[i].len; - lt.uid = (unsigned char *)malloc(lt.uid_max); + lt.uid = malloc(lt.uid_max); if (!lt.uid) error("can't allocate memory for large uid."); memcpy(lt.uid, packet->options[i].data, lt.uid_len); diff --git a/usr.sbin/dhcpd/dispatch.c b/usr.sbin/dhcpd/dispatch.c index ceb3856887b..a54f05220af 100644 --- a/usr.sbin/dhcpd/dispatch.c +++ b/usr.sbin/dhcpd/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.34 2014/10/08 04:26:07 deraadt Exp $ */ +/* $OpenBSD: dispatch.c,v 1.35 2015/08/20 22:39:29 deraadt Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998, 1999 @@ -156,7 +156,7 @@ discover_interfaces(int *rdomain) which we found it. */ if (!tmp->ifp) { int len = (IFNAMSIZ + ifa->ifa_addr->sa_len); - tif = (struct ifreq *)malloc(len); + tif = malloc(len); if (!tif) error("no space to remember ifp."); strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ); @@ -530,7 +530,7 @@ add_timeout(time_t when, void (*where)(void *), void *what) q->func = where; q->what = what; } else { - q = (struct dhcpd_timeout *)malloc(sizeof (struct dhcpd_timeout)); + q = malloc(sizeof (struct dhcpd_timeout)); if (!q) error("Can't allocate timeout structure!"); q->func = where; @@ -595,7 +595,7 @@ add_protocol(char *name, int fd, void (*handler)(struct protocol *), { struct protocol *p; - p = (struct protocol *)malloc(sizeof *p); + p = malloc(sizeof *p); if (!p) error("can't allocate protocol struct for %s", name); p->fd = fd; |