diff options
-rw-r--r-- | usr.sbin/mrinfo/mrinfo.c | 2 | ||||
-rw-r--r-- | usr.sbin/mrouted/callout.c | 2 | ||||
-rw-r--r-- | usr.sbin/mrouted/cfparse.y | 4 | ||||
-rw-r--r-- | usr.sbin/mrouted/prune.c | 6 | ||||
-rw-r--r-- | usr.sbin/mrouted/route.c | 6 | ||||
-rw-r--r-- | usr.sbin/mrouted/rsrr.c | 4 | ||||
-rw-r--r-- | usr.sbin/mrouted/vif.c | 8 | ||||
-rw-r--r-- | usr.sbin/tcpdump/addrtoname.c | 20 | ||||
-rw-r--r-- | usr.sbin/tcpdump/print-atalk.c | 4 | ||||
-rw-r--r-- | usr.sbin/tcpdump/print-decnet.c | 4 | ||||
-rw-r--r-- | usr.sbin/tcpdump/print-ip.c | 4 | ||||
-rw-r--r-- | usr.sbin/tcpdump/print-ip6.c | 4 | ||||
-rw-r--r-- | usr.sbin/tcpdump/print-lwres.c | 4 | ||||
-rw-r--r-- | usr.sbin/tcpdump/privsep.c | 4 | ||||
-rw-r--r-- | usr.sbin/tcpdump/privsep_pcap.c | 10 | ||||
-rw-r--r-- | usr.sbin/tcpdump/savestr.c | 4 |
16 files changed, 45 insertions, 45 deletions
diff --git a/usr.sbin/mrinfo/mrinfo.c b/usr.sbin/mrinfo/mrinfo.c index 55de2f0c8bc..c1f70d9723d 100644 --- a/usr.sbin/mrinfo/mrinfo.c +++ b/usr.sbin/mrinfo/mrinfo.c @@ -348,7 +348,7 @@ main(int argc, char *argv[]) if ((target_addr = inet_addr(host)) != -1) { hp = &bogus; hp->h_length = sizeof(target_addr); - if (!(hp->h_addr_list = (char **)calloc(2, sizeof(char *)))) + if (!(hp->h_addr_list = calloc(2, sizeof(char *)))) err(1, "can't allocate memory"); if (!(hp->h_addr_list[0] = malloc(hp->h_length))) err(1, "can't allocate memory"); diff --git a/usr.sbin/mrouted/callout.c b/usr.sbin/mrouted/callout.c index d3c24357675..283f01bdc6f 100644 --- a/usr.sbin/mrouted/callout.c +++ b/usr.sbin/mrouted/callout.c @@ -95,7 +95,7 @@ timer_setTimer(int delay, cfunc_t action, char *data) in_callout = 1; /* create a node */ - node = (struct timeout_q *)malloc(sizeof(struct timeout_q)); + node = malloc(sizeof(struct timeout_q)); if (node == 0) { logit(LOG_WARNING, 0, "Malloc Failed in timer_settimer\n"); in_callout = 0; diff --git a/usr.sbin/mrouted/cfparse.y b/usr.sbin/mrouted/cfparse.y index fe259b1c3e2..9269812d323 100644 --- a/usr.sbin/mrouted/cfparse.y +++ b/usr.sbin/mrouted/cfparse.y @@ -246,7 +246,7 @@ ifmod : mod struct phaddr *ph; - ph = (struct phaddr *)malloc(sizeof(struct phaddr)); + ph = malloc(sizeof(struct phaddr)); if (ph == NULL) fatal("out of memory"); if ($2.mask) { @@ -300,7 +300,7 @@ mod : THRESHOLD NUMBER { if ($2 < 1 || $2 > 255) struct vif_acl *v_acl; - v_acl = (struct vif_acl *)malloc(sizeof(struct vif_acl)); + v_acl = malloc(sizeof(struct vif_acl)); if (v_acl == NULL) fatal("out of memory"); VAL_TO_MASK(v_acl->acl_mask, $2.mask); diff --git a/usr.sbin/mrouted/prune.c b/usr.sbin/mrouted/prune.c index 2e4573bc615..3f0594ddce7 100644 --- a/usr.sbin/mrouted/prune.c +++ b/usr.sbin/mrouted/prune.c @@ -417,7 +417,7 @@ add_table_entry(u_int32_t origin, u_int32_t mcastgrp) } if (gt == NULL || gt->gt_mcastgrp != mcastgrp) { - gt = (struct gtable *)malloc(sizeof(struct gtable)); + gt = malloc(sizeof(struct gtable)); if (gt == NULL) logit(LOG_ERR, 0, "ran out of memory"); @@ -498,7 +498,7 @@ add_table_entry(u_int32_t origin, u_int32_t mcastgrp) } if (st == NULL || st->st_origin != origin) { - st = (struct stable *)malloc(sizeof(struct stable)); + st = malloc(sizeof(struct stable)); if (st == NULL) logit(LOG_ERR, 0, "ran out of memory"); @@ -988,7 +988,7 @@ accept_prune(u_int32_t src, u_int32_t dst, char *p, int datalen) pt->pt_timer = prun_tmr; } else { /* allocate space for the prune structure */ - pt = (struct ptable *)(malloc(sizeof(struct ptable))); + pt = malloc(sizeof(struct ptable)); if (pt == NULL) logit(LOG_ERR, 0, "pt: ran out of memory"); diff --git a/usr.sbin/mrouted/route.c b/usr.sbin/mrouted/route.c index c13fecb32ca..9271eb2d122 100644 --- a/usr.sbin/mrouted/route.c +++ b/usr.sbin/mrouted/route.c @@ -283,9 +283,9 @@ create_route(u_int32_t origin, u_int32_t mask) { struct rtentry *r; - if ((r = (struct rtentry *) malloc(sizeof(struct rtentry) + - (2 * numvifs * sizeof(u_int32_t)) + - (numvifs * sizeof(u_int)))) == NULL) { + if ((r = malloc(sizeof(struct rtentry) + + (2 * numvifs * sizeof(u_int32_t)) + + (numvifs * sizeof(u_int)))) == NULL) { logit(LOG_ERR, 0, "ran out of memory"); /* fatal */ } r->rt_origin = origin; diff --git a/usr.sbin/mrouted/rsrr.c b/usr.sbin/mrouted/rsrr.c index 252cdea2fea..b038a851003 100644 --- a/usr.sbin/mrouted/rsrr.c +++ b/usr.sbin/mrouted/rsrr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsrr.c,v 1.13 2015/01/16 06:40:18 deraadt Exp $ */ +/* $OpenBSD: rsrr.c,v 1.14 2015/08/21 02:07:32 deraadt Exp $ */ /* $NetBSD: rsrr.c,v 1.3 1995/12/10 10:07:14 mycroft Exp $ */ /* @@ -423,7 +423,7 @@ rsrr_cache(struct gtable *gt, struct rsrr_rq *route_query) /* Cache entry doesn't already exist. Create one and insert at * front of list. */ - rc = (struct rsrr_cache *) malloc(sizeof(struct rsrr_cache)); + rc = malloc(sizeof(struct rsrr_cache)); if (rc == NULL) logit(LOG_ERR, 0, "ran out of memory"); rc->route_query.source_addr.s_addr = route_query->source_addr.s_addr; diff --git a/usr.sbin/mrouted/vif.c b/usr.sbin/mrouted/vif.c index a427f427d56..be1baf52299 100644 --- a/usr.sbin/mrouted/vif.c +++ b/usr.sbin/mrouted/vif.c @@ -572,7 +572,7 @@ accept_group_report(u_int32_t src, u_int32_t dst, u_int32_t group, * If not found, add it to the list and update kernel cache. */ if (g == NULL) { - g = (struct listaddr *)malloc(sizeof(struct listaddr)); + g = malloc(sizeof(struct listaddr)); if (g == NULL) logit(LOG_ERR, 0, "ran out of memory"); /* fatal */ @@ -1049,7 +1049,7 @@ update_neighbor(vifi_t vifi, u_int32_t addr, int msgtype, char *p, inet_fmt(addr, s1), vifi, level & 0xff, (level >> 8) & 0xff, (level >> 16) & 0xff); - n = (struct listaddr *)malloc(sizeof(struct listaddr)); + n = malloc(sizeof(struct listaddr)); if (n == NULL) logit(LOG_ERR, 0, "ran out of memory"); /* fatal */ @@ -1388,7 +1388,7 @@ SetTimer(int vifi, struct listaddr *g) { cbk_t *cbk; - cbk = (cbk_t *) malloc(sizeof(cbk_t)); + cbk = malloc(sizeof(cbk_t)); cbk->g = g; cbk->vifi = vifi; return timer_setTimer(g->al_timer, (cfunc_t)DelVif, (void *)cbk); @@ -1428,7 +1428,7 @@ SetQueryTimer(struct listaddr *g, vifi_t vifi, int to_expire, int q_time) { cbk_t *cbk; - cbk = (cbk_t *) malloc(sizeof(cbk_t)); + cbk = malloc(sizeof(cbk_t)); cbk->g = g; cbk->q_time = q_time; cbk->vifi = vifi; diff --git a/usr.sbin/tcpdump/addrtoname.c b/usr.sbin/tcpdump/addrtoname.c index fb87a9fc9f3..3c1f3666392 100644 --- a/usr.sbin/tcpdump/addrtoname.c +++ b/usr.sbin/tcpdump/addrtoname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: addrtoname.c,v 1.33 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: addrtoname.c,v 1.34 2015/08/21 02:07:32 deraadt Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -324,7 +324,7 @@ lookup_emem(const u_char *ep) tp->e_addr0 = i; tp->e_addr1 = j; tp->e_addr2 = k; - tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); + tp->e_nxt = calloc(1, sizeof(*tp)); if (tp->e_nxt == NULL) error("lookup_emem: calloc"); @@ -367,11 +367,11 @@ lookup_bytestring(register const u_char *bs, const int nlen) tp->e_addr1 = j; tp->e_addr2 = k; - tp->e_bs = (u_char *) calloc(1, nlen + 1); + tp->e_bs = calloc(1, nlen + 1); if (tp->e_bs == NULL) error("lookup_bytestring: calloc"); bcopy(bs, tp->e_bs, nlen); - tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); + tp->e_nxt = calloc(1, sizeof(*tp)); if (tp->e_nxt == NULL) error("lookup_bytestring: calloc"); @@ -410,11 +410,11 @@ lookup_nsap(register const u_char *nsap) tp->e_addr0 = i; tp->e_addr1 = j; tp->e_addr2 = k; - tp->e_nsap = (u_char *)malloc(nlen + 1); + tp->e_nsap = malloc(nlen + 1); if (tp->e_nsap == NULL) error("lookup_nsap: malloc"); memcpy((char *)tp->e_nsap, (char *)nsap, nlen + 1); - tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); + tp->e_nxt = calloc(1, sizeof(*tp)); if (tp->e_nxt == NULL) error("lookup_nsap: calloc"); @@ -442,7 +442,7 @@ lookup_protoid(const u_char *pi) tp = tp->p_nxt; tp->p_oui = i; tp->p_proto = j; - tp->p_nxt = (struct protoidmem *)calloc(1, sizeof(*tp)); + tp->p_nxt = calloc(1, sizeof(*tp)); if (tp->p_nxt == NULL) error("lookup_protoid: calloc"); @@ -586,7 +586,7 @@ isonsap_string(const u_char *nsap) if (tp->e_name) return tp->e_name; - tp->e_name = cp = (char *)malloc(nlen * 2 + 2); + tp->e_name = cp = malloc(nlen * 2 + 2); if (cp == NULL) error("isonsap_string: malloc"); @@ -896,7 +896,7 @@ newhnamemem(void) if (num <= 0) { num = 64; - ptr = (struct hnamemem *)calloc(num, sizeof (*ptr)); + ptr = calloc(num, sizeof (*ptr)); if (ptr == NULL) error("newhnamemem: calloc"); } @@ -916,7 +916,7 @@ newh6namemem(void) if (num <= 0) { num = 64; - ptr = (struct h6namemem *)calloc(num, sizeof (*ptr)); + ptr = calloc(num, sizeof (*ptr)); if (ptr == NULL) error("newh6namemem: calloc"); } diff --git a/usr.sbin/tcpdump/print-atalk.c b/usr.sbin/tcpdump/print-atalk.c index 513267660be..7362ee264fe 100644 --- a/usr.sbin/tcpdump/print-atalk.c +++ b/usr.sbin/tcpdump/print-atalk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-atalk.c,v 1.28 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-atalk.c,v 1.29 2015/08/21 02:07:32 deraadt Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -224,7 +224,7 @@ ddp_print(register const u_char *bp, register u_int length, register int t, clen = snaplen; if (abuf == NULL) { - abuf = (u_char *)malloc(snaplen); + abuf = malloc(snaplen); if (abuf == NULL) error("ddp_print: malloc"); } diff --git a/usr.sbin/tcpdump/print-decnet.c b/usr.sbin/tcpdump/print-decnet.c index 6e47c8d7508..15920de10ab 100644 --- a/usr.sbin/tcpdump/print-decnet.c +++ b/usr.sbin/tcpdump/print-decnet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-decnet.c,v 1.13 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-decnet.c,v 1.14 2015/08/21 02:07:32 deraadt Exp $ */ /* * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997 @@ -731,7 +731,7 @@ dnnum_string(u_short dnaddr) int node = dnaddr & NODEMASK; int len = sizeof("00.0000"); - str = (char *)malloc(len); + str = malloc(len); if (str == NULL) error("dnnum_string: malloc"); snprintf(str, len, "%d.%d", area, node); diff --git a/usr.sbin/tcpdump/print-ip.c b/usr.sbin/tcpdump/print-ip.c index d6940d7d1a2..1920ab64111 100644 --- a/usr.sbin/tcpdump/print-ip.c +++ b/usr.sbin/tcpdump/print-ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ip.c,v 1.43 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-ip.c,v 1.44 2015/08/21 02:07:32 deraadt Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -377,7 +377,7 @@ ip_print(register const u_char *bp, register u_int length) if (clen > snaplen) clen = snaplen; if (abuf == NULL) { - abuf = (u_char *)malloc(snaplen); + abuf = malloc(snaplen); if (abuf == NULL) error("ip_print: malloc"); } diff --git a/usr.sbin/tcpdump/print-ip6.c b/usr.sbin/tcpdump/print-ip6.c index 269c522cdc5..08c6e8b2bb7 100644 --- a/usr.sbin/tcpdump/print-ip6.c +++ b/usr.sbin/tcpdump/print-ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ip6.c,v 1.21 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-ip6.c,v 1.22 2015/08/21 02:07:32 deraadt Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 @@ -79,7 +79,7 @@ ip6_print(register const u_char *bp, register u_int length) clen = snaplen; if (abuf == NULL) { - abuf = (u_char *)malloc(snaplen); + abuf = malloc(snaplen); if (abuf == NULL) error("ip6_print: malloc"); } diff --git a/usr.sbin/tcpdump/print-lwres.c b/usr.sbin/tcpdump/print-lwres.c index 5f91bcc8396..d4f77505214 100644 --- a/usr.sbin/tcpdump/print-lwres.c +++ b/usr.sbin/tcpdump/print-lwres.c @@ -277,11 +277,11 @@ lwres_printb64len(const char *p0) if (p + 2 + l > (u_int8_t *)snapend) goto trunc; - dbuf = (char *)malloc(l + 1); + dbuf = malloc(l + 1); if (!dbuf) return -1; - b64buf = (char *)malloc((l + 2) * 4 / 3); + b64buf = malloc((l + 2) * 4 / 3); if (!b64buf) { free(dbuf); diff --git a/usr.sbin/tcpdump/privsep.c b/usr.sbin/tcpdump/privsep.c index 6f0c0861a36..354b384a1f3 100644 --- a/usr.sbin/tcpdump/privsep.c +++ b/usr.sbin/tcpdump/privsep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep.c,v 1.34 2015/07/14 20:23:40 deraadt Exp $ */ +/* $OpenBSD: privsep.c,v 1.35 2015/08/21 02:07:32 deraadt Exp $ */ /* * Copyright (c) 2003 Can Erkin Acar @@ -570,7 +570,7 @@ impl_getlines(int fd) if (buf[len - 1] == '\n') buf[len - 1] = '\0'; else { - if ((lbuf = (char *)malloc(len + 1)) == NULL) + if ((lbuf = malloc(len + 1)) == NULL) err(1, NULL); memcpy(lbuf, buf, len); lbuf[len] = '\0'; diff --git a/usr.sbin/tcpdump/privsep_pcap.c b/usr.sbin/tcpdump/privsep_pcap.c index 032df06e12c..94acdeaea93 100644 --- a/usr.sbin/tcpdump/privsep_pcap.c +++ b/usr.sbin/tcpdump/privsep_pcap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep_pcap.c,v 1.17 2012/11/14 03:33:04 lteo Exp $ */ +/* $OpenBSD: privsep_pcap.c,v 1.18 2015/08/21 02:07:32 deraadt Exp $ */ /* * Copyright (c) 2004 Can Erkin Acar @@ -239,7 +239,7 @@ priv_pcap_live(const char *dev, int slen, int prom, int to_ms, return (NULL); } - p = (pcap_t *)malloc(sizeof(*p)); + p = malloc(sizeof(*p)); if (p == NULL) { snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s", pcap_strerror(errno)); @@ -324,7 +324,7 @@ priv_pcap_live(const char *dev, int slen, int prom, int to_ms, goto bad; } p->bufsize = v; - p->buffer = (u_char *)malloc(p->bufsize); + p->buffer = malloc(p->bufsize); if (p->buffer == NULL) { snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s", pcap_strerror(errno)); @@ -368,7 +368,7 @@ priv_pcap_offline(const char *fname, char *errbuf) if (priv_fd < 0) errx(1, "%s: called from privileged portion", __func__); - p = (pcap_t *)malloc(sizeof(*p)); + p = malloc(sizeof(*p)); if (p == NULL) { strlcpy(errbuf, "out of swap", PCAP_ERRBUF_SIZE); return (NULL); @@ -445,7 +445,7 @@ priv_pcap_offline(const char *fname, char *errbuf) if (p->bufsize < 0) p->bufsize = BPF_MAXBUFSIZE; - p->sf.base = (u_char *)malloc(p->bufsize + BPF_ALIGNMENT); + p->sf.base = malloc(p->bufsize + BPF_ALIGNMENT); if (p->sf.base == NULL) { strlcpy(errbuf, "out of swap", PCAP_ERRBUF_SIZE); goto bad; diff --git a/usr.sbin/tcpdump/savestr.c b/usr.sbin/tcpdump/savestr.c index b0fc6df6fc0..2d8a253221f 100644 --- a/usr.sbin/tcpdump/savestr.c +++ b/usr.sbin/tcpdump/savestr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: savestr.c,v 1.8 2015/04/05 17:02:57 guenther Exp $ */ +/* $OpenBSD: savestr.c,v 1.9 2015/08/21 02:07:32 deraadt Exp $ */ /* * Copyright (c) 1997 @@ -47,7 +47,7 @@ savestr(register const char *str) strsize = 1024; if (strsize < size) strsize = size; - strptr = (char *)malloc(strsize); + strptr = malloc(strsize); if (strptr == NULL) { fprintf(stderr, "savestr: malloc\n"); exit(1); |