summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-07-13 15:29:04 +0000
committertedu <tedu@openbsd.org>2014-07-13 15:29:04 +0000
commit47e7ee29c3bb7cf8aea4f2198bbeaca547bc731f (patch)
tree314cb49ac3d0a1406adb1335a1738dab82084923 /sys/kern/tty.c
parentSync file to be identical in relayd(8) and httpd(8). (diff)
downloadwireguard-openbsd-47e7ee29c3bb7cf8aea4f2198bbeaca547bc731f.tar.xz
wireguard-openbsd-47e7ee29c3bb7cf8aea4f2198bbeaca547bc731f.zip
use mallocarray where arguments are multipled. ok deraadt
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 41b42bab418..8a3a41189a4 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.112 2014/07/13 14:56:56 guenther Exp $ */
+/* $OpenBSD: tty.c,v 1.113 2014/07/13 15:29:04 tedu Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -2369,7 +2369,7 @@ ttystats_init(struct itty **ttystats)
struct itty *itp;
struct tty *tp;
- *ttystats = malloc(tty_count * sizeof(struct itty),
+ *ttystats = mallocarray(tty_count, sizeof(struct itty),
M_SYSCTL, M_WAITOK|M_ZERO);
for (tp = TAILQ_FIRST(&ttylist), itp = *ttystats; tp;
tp = TAILQ_NEXT(tp, tty_link), itp++) {