summaryrefslogtreecommitdiff
path: root/usr.bin/showmount
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-08-20 22:32:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-08-20 22:32:43 +0000
commit6e5d9523d6273368df6377a4db98a9533d11505c (patch)
tree665d65c04b5874cca0392587a8c45d740f3af051 /usr.bin/showmount
parent856a95e3f951c7875c113b683b773a7bccf1e685 (diff)
Do not cast result of malloc/calloc/realloc* if stdlib.h is in scope
ok krw millert
Diffstat (limited to 'usr.bin/showmount')
-rw-r--r--usr.bin/showmount/showmount.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/showmount/showmount.c b/usr.bin/showmount/showmount.c
index 0ed5200ad4f..694dee7400b 100644
--- a/usr.bin/showmount/showmount.c
+++ b/usr.bin/showmount/showmount.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: showmount.c,v 1.17 2009/10/27 23:59:43 deraadt Exp $ */
+/* $OpenBSD: showmount.c,v 1.18 2015/08/20 22:32:42 deraadt Exp $ */
/* $NetBSD: showmount.c,v 1.7 1996/05/01 18:14:10 cgd Exp $ */
/*
@@ -235,7 +235,7 @@ xdr_mntdump(XDR *xdrsp, struct mountlist **mlp)
if (!xdr_bool(xdrsp, &bool))
return (0);
while (bool) {
- mp = (struct mountlist *)malloc(sizeof(struct mountlist));
+ mp = malloc(sizeof(struct mountlist));
if (mp == NULL)
return (0);
mp->ml_left = mp->ml_right = (struct mountlist *)0;
@@ -313,7 +313,7 @@ xdr_exports(XDR *xdrsp, struct exportslist **exp)
if (!xdr_bool(xdrsp, &bool))
return (0);
while (bool) {
- ep = (struct exportslist *)malloc(sizeof(struct exportslist));
+ ep = malloc(sizeof(struct exportslist));
if (ep == NULL)
return (0);
ep->ex_groups = (struct grouplist *)0;
@@ -323,8 +323,7 @@ xdr_exports(XDR *xdrsp, struct exportslist **exp)
if (!xdr_bool(xdrsp, &grpbool))
return (0);
while (grpbool) {
- gp = (struct grouplist *)malloc(
- sizeof(struct grouplist));
+ gp = malloc(sizeof(struct grouplist));
if (gp == NULL)
return (0);
strp = gp->gr_name;