diff options
| author | 2014-07-13 23:18:01 +0000 | |
|---|---|---|
| committer | 2014-07-13 23:18:01 +0000 | |
| commit | 0394ebdb09a9aac1f1e67e7ec22450a804334568 (patch) | |
| tree | a5cb44eeda4c389d1fb251932a2b0019443e185a | |
| parent | Rename the context allocation from ressl_new to ressl_client, which makes (diff) | |
| download | wireguard-openbsd-0394ebdb09a9aac1f1e67e7ec22450a804334568.tar.xz wireguard-openbsd-0394ebdb09a9aac1f1e67e7ec22450a804334568.zip | |
use mallocarray
| -rw-r--r-- | sys/ufs/ufs/ufs_dirhash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c index 62d2c49455b..9eff2f8f97a 100644 --- a/sys/ufs/ufs/ufs_dirhash.c +++ b/sys/ufs/ufs/ufs_dirhash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_dirhash.c,v 1.26 2014/07/12 18:44:01 tedu Exp $ */ +/* $OpenBSD: ufs_dirhash.c,v 1.27 2014/07/13 23:18:01 tedu Exp $ */ /* * Copyright (c) 2001, 2002 Ian Dowse. All rights reserved. * @@ -174,9 +174,9 @@ ufsdirhash_build(struct inode *ip) DIRHASHLIST_UNLOCK(); return (-1); } - dh->dh_hash = malloc(narrays * sizeof(dh->dh_hash[0]), + dh->dh_hash = mallocarray(narrays, sizeof(dh->dh_hash[0]), M_DIRHASH, M_NOWAIT|M_ZERO); - dh->dh_blkfree = malloc(nblocks * sizeof(dh->dh_blkfree[0]), + dh->dh_blkfree = mallocarray(nblocks, sizeof(dh->dh_blkfree[0]), M_DIRHASH, M_NOWAIT | M_ZERO); if (dh->dh_hash == NULL || dh->dh_blkfree == NULL) goto fail; |
