diff options
| author | 2016-03-01 20:51:05 +0000 | |
|---|---|---|
| committer | 2016-03-01 20:51:05 +0000 | |
| commit | 6e2bb670cb53bca2bcf0d2beca1276e6eb7c6e90 (patch) | |
| tree | 78c2630e27554a96d70be79b167a193e7c61c242 | |
| parent | KNF this file; OK stsp@ (diff) | |
| download | wireguard-openbsd-6e2bb670cb53bca2bcf0d2beca1276e6eb7c6e90.tar.xz wireguard-openbsd-6e2bb670cb53bca2bcf0d2beca1276e6eb7c6e90.zip | |
fatal("malloc") -> fatal(NULL)
| -rw-r--r-- | usr.sbin/rtadvd/config.c | 20 | ||||
| -rw-r--r-- | usr.sbin/rtadvd/if.c | 6 | ||||
| -rw-r--r-- | usr.sbin/rtadvd/rtadvd.c | 8 | ||||
| -rw-r--r-- | usr.sbin/rtadvd/timer.c | 4 |
4 files changed, 19 insertions, 19 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c index dd635cc5c24..367b46bed0a 100644 --- a/usr.sbin/rtadvd/config.c +++ b/usr.sbin/rtadvd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.55 2016/03/01 12:52:43 jca Exp $ */ +/* $OpenBSD: config.c,v 1.56 2016/03/01 20:51:05 jca Exp $ */ /* $KAME: config.c,v 1.62 2002/05/29 10:13:10 itojun Exp $ */ /* @@ -105,7 +105,7 @@ getconfig(char *intface) } if ((tmp = calloc(1, sizeof(*tmp))) == NULL) - fatal("malloc"); + fatal(NULL); TAILQ_INIT(&tmp->prefixes); TAILQ_INIT(&tmp->rtinfos); @@ -243,7 +243,7 @@ getconfig(char *intface) /* allocate memory to store prefix information */ if ((pfx = calloc(1, sizeof(*pfx))) == NULL) - fatal("calloc"); + fatal(NULL); /* link into chain */ TAILQ_INSERT_TAIL(&tmp->prefixes, pfx, entry); @@ -335,7 +335,7 @@ getconfig(char *intface) rti = malloc(sizeof(struct rtinfo)); if (rti == NULL) - fatal("malloc"); + fatal(NULL); if (inet_pton(AF_INET6, addr, &rti->prefix) != 1) { log_warn("inet_pton failed for %s", addr); @@ -411,7 +411,7 @@ getconfig(char *intface) rds = malloc(sizeof(struct rdnss) + val * sizeof(struct in6_addr)); if (rds == NULL) - fatal("malloc"); + fatal(NULL); TAILQ_INSERT_TAIL(&tmp->rdnsss, rds, entry); @@ -449,7 +449,7 @@ getconfig(char *intface) dsl = malloc(sizeof(struct dnssl)); if (dsl == NULL) - fatal("malloc"); + fatal(NULL); TAILQ_INIT(&dsl->dnssldoms); @@ -465,7 +465,7 @@ getconfig(char *intface) dnsd = malloc(sizeof(struct dnssldom) + len + 1); if (dnsd == NULL) - fatal("malloc"); + fatal(NULL); dnsd->length = len; strlcpy(dnsd->domain, tmpsl, len + 1); @@ -564,7 +564,7 @@ get_prefix(struct rainfo *rai) /* allocate memory to store prefix info. */ if ((pp = calloc(1, sizeof(*pp))) == NULL) - fatal("calloc"); + fatal(NULL); /* set prefix, sweep bits outside of prefixlen */ pp->prefixlen = plen; @@ -625,7 +625,7 @@ make_prefix(struct rainfo *rai, int ifindex, struct in6_addr *addr, int plen) u_char ntopbuf[INET6_ADDRSTRLEN]; if ((prefix = calloc(1, sizeof(*prefix))) == NULL) { - log_warn("calloc"); + log_warn(NULL); return; /* XXX: error or exit? */ } prefix->prefix = *addr; @@ -734,7 +734,7 @@ make_packet(struct rainfo *rainfo) /* allocate memory for the packet */ if ((buf = malloc(packlen)) == NULL) - fatal("malloc"); + fatal(NULL); /* free the previous packet */ free(rainfo->ra_data); rainfo->ra_data = buf; diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c index b6d46d489dd..54de6c670e8 100644 --- a/usr.sbin/rtadvd/if.c +++ b/usr.sbin/rtadvd/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.38 2016/03/01 12:52:43 jca Exp $ */ +/* $OpenBSD: if.c,v 1.39 2016/03/01 20:51:05 jca Exp $ */ /* $KAME: if.c,v 1.17 2001/01/21 15:27:30 itojun Exp $ */ /* @@ -427,7 +427,7 @@ get_iflist(char **buf, size_t *size) if (*size == 0) break; if ((*buf = realloc(*buf, *size)) == NULL) - fatal("malloc"); + fatal(NULL); if (sysctl(mib, 6, *buf, size, NULL, 0) == -1) { if (errno == ENOMEM) continue; @@ -457,7 +457,7 @@ parse_iflist(struct if_msghdr ***ifmlist_p, char *buf, size_t bufsize) /* roughly estimate max list size of pointers to each if_msghdr */ malloc_size = (bufsize/iflentry_size) * sizeof(size_t); if ((*ifmlist_p = malloc(malloc_size)) == NULL) - fatal("malloc"); + fatal(NULL); lim = buf + bufsize; for (ifm = (struct if_msghdr *)buf; ifm < (struct if_msghdr *)lim;) { diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c index c7ba15af363..01520455506 100644 --- a/usr.sbin/rtadvd/rtadvd.c +++ b/usr.sbin/rtadvd/rtadvd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtadvd.c,v 1.72 2016/03/01 12:52:43 jca Exp $ */ +/* $OpenBSD: rtadvd.c,v 1.73 2016/03/01 20:51:05 jca Exp $ */ /* $KAME: rtadvd.c,v 1.66 2002/05/29 14:18:36 itojun Exp $ */ /* @@ -1081,7 +1081,7 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, continue; } if ((pfx = malloc(sizeof(*pfx))) == NULL) { - log_warn("malloc"); + log_warn(NULL); goto bad; } @@ -1129,13 +1129,13 @@ sock_open(void) CMSG_SPACE(sizeof(int)); rcvcmsgbuf = malloc(rcvcmsgbuflen); if (rcvcmsgbuf == NULL) - fatal("malloc"); + fatal(NULL); sndcmsgbuflen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(sizeof(int)); sndcmsgbuf = malloc(sndcmsgbuflen); if (sndcmsgbuf == NULL) - fatal("malloc"); + fatal(NULL); if ((sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) fatal("socket"); diff --git a/usr.sbin/rtadvd/timer.c b/usr.sbin/rtadvd/timer.c index 548da1985e3..58bf0da8a15 100644 --- a/usr.sbin/rtadvd/timer.c +++ b/usr.sbin/rtadvd/timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timer.c,v 1.15 2016/02/08 23:19:00 jca Exp $ */ +/* $OpenBSD: timer.c,v 1.16 2016/03/01 20:51:05 jca Exp $ */ /* $KAME: timer.c,v 1.7 2002/05/21 14:26:55 itojun Exp $ */ /* @@ -49,7 +49,7 @@ rtadvd_add_timer(void (*timeout)(void *), struct rtadvd_timer *newtimer; if ((newtimer = calloc(1, sizeof(*newtimer))) == NULL) - fatal("calloc"); + fatal(NULL); if (timeout == NULL) fatalx("timeout function unspecified"); |
