From a6a568708b99d21a8efa7db409ec3f5d8714b75e Mon Sep 17 00:00:00 2001 From: Xin LI Date: Wed, 5 Mar 2008 23:17:19 +0000 Subject: [PATCH] Use calloc(). --- sbin/newfs/mkfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index c8a09b6e6c43..b3bbcbf3b351 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -497,11 +497,10 @@ mkfs(struct partition *pp, char *fsys) iobufsize = SBLOCKSIZE + 3 * sblock.fs_bsize; else iobufsize = 4 * sblock.fs_bsize; - if ((iobuf = malloc(iobufsize)) == 0) { + if ((iobuf = calloc(1, iobufsize)) == 0) { printf("Cannot allocate I/O buffer\n"); exit(38); } - bzero(iobuf, iobufsize); /* * Make a copy of the superblock into the buffer that we will be * writing out in each cylinder group.