summaryrefslogtreecommitdiffstats
path: root/ipv6rs.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2013-02-15 21:45:08 +0000
committerRoy Marples <roy@marples.name>2013-02-15 21:45:08 +0000
commit10e17e3f635f816cbd8717ced563b4edfe2f5aea (patch)
tree46daf567f85c55bd574c916e711bd4f013fc69aa /ipv6rs.c
parentfbbb0875dd748a22dcf6d91a7d3cdaed5a90dc58 (diff)
downloaddhcpcd-10e17e3f635f816cbd8717ced563b4edfe2f5aea.tar.xz
Remove xzalloc function
Diffstat (limited to 'ipv6rs.c')
-rw-r--r--ipv6rs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ipv6rs.c b/ipv6rs.c
index ac30346c..a1bd9d14 100644
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -207,7 +207,7 @@ ipv6rs_makeprobe(struct interface *ifp)
state = RS_STATE(ifp);
free(state->rs);
state->rslen = sizeof(*rs) + ROUNDUP8(ifp->hwlen + 2);
- state->rs = xzalloc(state->rslen);
+ state->rs = calloc(1, state->rslen);
if (state->rs == NULL)
return -1;
rs = (struct nd_router_solicit *)(void *)state->rs;
@@ -512,7 +512,11 @@ ipv6rs_handledata(_unused void *arg)
new_data = 0;
if (rap == NULL) {
- rap = xzalloc(sizeof(*rap));
+ rap = calloc(1, sizeof(*rap));
+ if (rap == NULL) {
+ syslog(LOG_ERR, "%s: %m", __func__);
+ return;
+ }
rap->iface = ifp;
memcpy(rap->from.s6_addr, from.sin6_addr.s6_addr,
sizeof(rap->from.s6_addr));