summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-10-08 04:48:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-10-08 04:48:23 +0000
commit21cc1a046497627e2a99f4bd4c248875bea0e57b (patch)
tree4e65574f8aff8346054fb2658401ef749703f14c /usr.sbin
parent266aa92ec9967cbc146d9222bb387e5344d95c1a (diff)
use reallocarray(). BTW << 3 is a sloppy compared to * sizeof(u_int64_t)...
ok doug
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rdate/ntpleaps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/rdate/ntpleaps.c b/usr.sbin/rdate/ntpleaps.c
index 10db06e9abc..8c9323e5d23 100644
--- a/usr.sbin/rdate/ntpleaps.c
+++ b/usr.sbin/rdate/ntpleaps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntpleaps.c,v 1.12 2014/04/13 05:38:45 jsg Exp $ */
+/* $OpenBSD: ntpleaps.c,v 1.13 2014/10/08 04:48:22 deraadt Exp $ */
/*
* Copyright (c) 2002 Thorsten Glaser. All rights reserved.
@@ -152,7 +152,7 @@ ntpleaps_read(void)
close(fd);
return (-1);
}
- if ((l = (u_int64_t *)malloc(r << 3)) == NULL) {
+ if ((l = reallocarray(NULL, r, sizeof(u_int64_t))) == NULL) {
close(fd);
return (-1);
}