summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/ps/ps.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index db576ae97cf..87274f1e2da 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ps.c,v 1.42 2006/11/01 19:07:18 jmc Exp $ */
+/* $OpenBSD: ps.c,v 1.43 2007/09/01 19:32:19 deraadt Exp $ */
/* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: ps.c,v 1.42 2006/11/01 19:07:18 jmc Exp $";
+static char rcsid[] = "$OpenBSD: ps.c,v 1.43 2007/09/01 19:32:19 deraadt Exp $";
#endif
#endif /* not lint */
@@ -361,7 +361,7 @@ main(int argc, char *argv[])
* sort proc list, we convert from an array of structs to an array
* of pointers to make the sort cheaper.
*/
- if ((kinfo = malloc(sizeof(*kinfo) * nentries)) == NULL)
+ if ((kinfo = calloc(sizeof(*kinfo), nentries)) == NULL)
err(1, "failed to allocate memory for proc pointers");
for (i = 0; i < nentries; i++)
kinfo[i] = &kp[i];