diff options
| author | Roy Marples <roy@marples.name> | 2013-02-15 21:45:08 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2013-02-15 21:45:08 +0000 |
| commit | 10e17e3f635f816cbd8717ced563b4edfe2f5aea (patch) | |
| tree | 46daf567f85c55bd574c916e711bd4f013fc69aa /ipv6rs.c | |
| parent | fbbb0875dd748a22dcf6d91a7d3cdaed5a90dc58 (diff) | |
| download | dhcpcd-10e17e3f635f816cbd8717ced563b4edfe2f5aea.tar.xz | |
Remove xzalloc function
Diffstat (limited to 'ipv6rs.c')
| -rw-r--r-- | ipv6rs.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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)); |
