summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-08-09 22:44:16 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-08-09 22:44:16 +0000
commit2adc8708854273065221d48a0b3bb3af9b1a0a9c (patch)
treefd1a7f298b97e6d3887fd19336b13d2f09a9b085 /bin
parent08bc531995741df21842e5bfcc6325b5bd78980d (diff)
Switch from calloc() to reallocarray() where the zeroing isn't needed
Diffstat (limited to 'bin')
-rw-r--r--bin/systrace/systrace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/systrace/systrace.c b/bin/systrace/systrace.c
index 80a3fa4a96d..86fac087890 100644
--- a/bin/systrace/systrace.c
+++ b/bin/systrace/systrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: systrace.c,v 1.58 2012/12/04 02:24:47 deraadt Exp $ */
+/* $OpenBSD: systrace.c,v 1.59 2014/08/09 22:44:15 guenther Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -753,7 +753,8 @@ main(int argc, char **argv)
if (pidattach == 0) {
/* Run a command and attach to it */
- if ((args = calloc(argc + 1, sizeof(char *))) == NULL)
+ args = reallocarray(NULL, argc + 1, sizeof(char *));
+ if (args == NULL)
err(1, "malloc");
for (i = 0; i < argc; i++)