summaryrefslogtreecommitdiff
path: root/sbin/newfs_ext2fs
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-04-22 00:22:42 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-04-22 00:22:42 +0000
commitfb53557795d818792f8d0f9a6b6d89a901d1bff7 (patch)
tree49231b80a4b849e74c4076abbb5d18fe8cb8c6d1 /sbin/newfs_ext2fs
parentfdd3e8d48bca388671bdb977b2a4b02a9cfbe0df (diff)
Convert a malloc(x*y)+memset to calloc(x,y)
From Jean-Philippe Ouellet (jean-philippe (at) ouellet.biz)
Diffstat (limited to 'sbin/newfs_ext2fs')
-rw-r--r--sbin/newfs_ext2fs/mke2fs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sbin/newfs_ext2fs/mke2fs.c b/sbin/newfs_ext2fs/mke2fs.c
index 222eb0eab2c..9c2f0cd9bc7 100644
--- a/sbin/newfs_ext2fs/mke2fs.c
+++ b/sbin/newfs_ext2fs/mke2fs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mke2fs.c,v 1.6 2013/12/27 19:17:28 deraadt Exp $ */
+/* $OpenBSD: mke2fs.c,v 1.7 2014/04/22 00:22:41 guenther Exp $ */
/* $NetBSD: mke2fs.c,v 1.13 2009/10/19 18:41:08 bouyer Exp $ */
/*-
@@ -465,10 +465,9 @@ mke2fs(const char *fsys, int fi, int fo)
/*
* Initialize group descriptors
*/
- gd = malloc(sblock.e2fs_ngdb * bsize);
+ gd = calloc(sblock.e2fs_ngdb, bsize);
if (gd == NULL)
errx(EXIT_FAILURE, "Can't allocate descriptors buffer");
- memset(gd, 0, sblock.e2fs_ngdb * bsize);
fbcount = 0;
ficount = 0;