Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/fsck_ffs initialise memory allocated for uquot_user_has...



details:   https://anonhg.NetBSD.org/src/rev/5fffb9199ad3
branches:  trunk
changeset: 763446:5fffb9199ad3
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Mar 20 11:41:24 2011 +0000

description:
initialise memory allocated for uquot_user_hash & uquot_group_hash.
Pointed out by Nicolas Joly.

diffstat:

 sbin/fsck_ffs/setup.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 9f360fb769ed -r 5fffb9199ad3 sbin/fsck_ffs/setup.c
--- a/sbin/fsck_ffs/setup.c     Sun Mar 20 09:04:53 2011 +0000
+++ b/sbin/fsck_ffs/setup.c     Sun Mar 20 11:41:24 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: setup.c,v 1.91 2011/03/06 17:08:16 bouyer Exp $        */
+/*     $NetBSD: setup.c,v 1.92 2011/03/20 11:41:24 bouyer Exp $        */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)setup.c    8.10 (Berkeley) 5/9/95";
 #else
-__RCSID("$NetBSD: setup.c,v 1.91 2011/03/06 17:08:16 bouyer Exp $");
+__RCSID("$NetBSD: setup.c,v 1.92 2011/03/20 11:41:24 bouyer Exp $");
 #endif
 #endif /* not lint */
 
@@ -565,9 +565,9 @@
                            q2h_hash_mask);
                }
                uquot_user_hash =
-                   malloc((1 << q2h_hash_shift) * sizeof(struct uquot_hash));
+                   calloc((1 << q2h_hash_shift), sizeof(struct uquot_hash));
                uquot_group_hash =
-                   malloc((1 << q2h_hash_shift) * sizeof(struct uquot_hash));
+                   calloc((1 << q2h_hash_shift), sizeof(struct uquot_hash));
                if (uquot_user_hash == NULL || uquot_group_hash == NULL)
                        errexit("Cannot allocate space for quotas hash\n");
        } else {



Home | Main Index | Thread Index | Old Index