summaryrefslogtreecommitdiff
path: root/sys/ntfs/ntfs_subr.c
diff options
context:
space:
mode:
authorDoug Hogan <doug@cvs.openbsd.org>2014-12-09 07:16:42 +0000
committerDoug Hogan <doug@cvs.openbsd.org>2014-12-09 07:16:42 +0000
commit88a10729b63956a2b341ff5db15faba245b04025 (patch)
tree04fdbf12c61a6aa03d7784a71201ec6fb4243afb /sys/ntfs/ntfs_subr.c
parent8f456837b1fba053042852c2b58706cec1ae226e (diff)
Sprinkle in a little more mallocarray().
ok deraadt@ tedu@
Diffstat (limited to 'sys/ntfs/ntfs_subr.c')
-rw-r--r--sys/ntfs/ntfs_subr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/ntfs/ntfs_subr.c b/sys/ntfs/ntfs_subr.c
index 91192ee0124..aa2984dbbb3 100644
--- a/sys/ntfs/ntfs_subr.c
+++ b/sys/ntfs/ntfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_subr.c,v 1.39 2014/09/14 14:17:26 jsg Exp $ */
+/* $OpenBSD: ntfs_subr.c,v 1.40 2014/12/09 07:16:41 doug Exp $ */
/* $NetBSD: ntfs_subr.c,v 1.4 2003/04/10 21:37:32 jdolecek Exp $ */
/*-
@@ -611,8 +611,8 @@ ntfs_runtovrun(cn_t **rcnp, cn_t **rclp, u_long *rcntp, u_int8_t *run)
off += (run[off] & 0xF) + ((run[off] >> 4) & 0xF) + 1;
cnt++;
}
- cn = malloc(cnt * sizeof(cn_t), M_NTFSRUN, M_WAITOK);
- cl = malloc(cnt * sizeof(cn_t), M_NTFSRUN, M_WAITOK);
+ cn = mallocarray(cnt, sizeof(cn_t), M_NTFSRUN, M_WAITOK);
+ cl = mallocarray(cnt, sizeof(cn_t), M_NTFSRUN, M_WAITOK);
off = 0;
cnt = 0;