diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-05-17 05:27:52 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-05-17 05:27:52 +0000 |
commit | f6d289008c5938514430b8d1afd00d3711a33e56 (patch) | |
tree | d2a35e41434d5837169a7025a25d3d714137b4ab /usr.sbin/rpcbind/rpcbind.c | |
parent | ed1adbad3e9ffee245c5a657be186109a6f68b8d (diff) | |
download | FreeBSD-src-f6d289008c5938514430b8d1afd00d3711a33e56.zip FreeBSD-src-f6d289008c5938514430b8d1afd00d3711a33e56.tar.gz |
Stop this program's abuse of malloc(3). Its return value doesn't need these
ugly explicit casts, and its argument doesn't need explicitly cast to u_int,
especially if sizeof() is being used.
Diffstat (limited to 'usr.sbin/rpcbind/rpcbind.c')
-rw-r--r-- | usr.sbin/rpcbind/rpcbind.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c index 2ddf2c0..8e93160 100644 --- a/usr.sbin/rpcbind/rpcbind.c +++ b/usr.sbin/rpcbind/rpcbind.c @@ -342,8 +342,8 @@ init_transport(struct netconfig *nconf) nconf->nc_netid); goto error; } - pml = (struct pmaplist *)malloc((u_int)sizeof (struct pmaplist)); - if (pml == (struct pmaplist *)NULL) { + pml = malloc(sizeof (struct pmaplist)); + if (pml == NULL) { syslog(LOG_ERR, "no memory!"); exit(1); } @@ -380,8 +380,8 @@ init_transport(struct netconfig *nconf) list_pml = pml; /* Add version 3 information */ - pml = (struct pmaplist *)malloc((u_int)sizeof (struct pmaplist)); - if (pml == (struct pmaplist *)NULL) { + pml = malloc(sizeof (struct pmaplist)); + if (pml == NULL) { syslog(LOG_ERR, "no memory!"); exit(1); } @@ -391,8 +391,8 @@ init_transport(struct netconfig *nconf) list_pml = pml; /* Add version 4 information */ - pml = (struct pmaplist *)malloc((u_int)sizeof (struct pmaplist)); - if (pml == (struct pmaplist *)NULL) { + pml = malloc (sizeof (struct pmaplist)); + if (pml == NULL) { syslog(LOG_ERR, "no memory!"); exit(1); } @@ -469,8 +469,8 @@ rbllist_add(rpcprog_t prog, rpcvers_t vers, struct netconfig *nconf, { rpcblist_ptr rbl; - rbl = (rpcblist_ptr)malloc((u_int)sizeof (rpcblist)); - if (rbl == (rpcblist_ptr)NULL) { + rbl = malloc(sizeof (rpcblist)); + if (rbl == NULL) { syslog(LOG_ERR, "no memory!"); exit(1); } |