summaryrefslogtreecommitdiff
path: root/sbin/atactl
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/atactl')
-rw-r--r--sbin/atactl/atactl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/atactl/atactl.c b/sbin/atactl/atactl.c
index 602b2f8f04a..6f82264ac63 100644
--- a/sbin/atactl/atactl.c
+++ b/sbin/atactl/atactl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atactl.c,v 1.37 2006/10/02 19:30:19 jmc Exp $ */
+/* $OpenBSD: atactl.c,v 1.38 2007/09/02 15:19:23 deraadt Exp $ */
/* $NetBSD: atactl.c,v 1.4 1999/02/24 18:49:14 jwise Exp $ */
/*-
@@ -1455,8 +1455,8 @@ device_smart_readlog(int argc, char *argv[])
* the latest one.
*/
nsect = nerr / 5 + (nerr % 5 != 0 ? 1 : 0);
- if ((newbuf = (u_int8_t *)malloc(nsect * DEV_BSIZE)) == NULL)
- err(1, "malloc()");
+ if ((newbuf = (u_int8_t *)calloc(nsect, DEV_BSIZE)) == NULL)
+ err(1, "calloc()");
memset(&req, 0, sizeof(req));
req.flags = ATACMD_READ;
req.command = ATAPI_SMART;