summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-05-07 01:27:43 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-05-07 01:27:43 +0000
commit6de9fac967ede5635a6815faa7c08e751b033f57 (patch)
tree670d8b084b1a3b726e14e822ea7b55f0eb7fc400
parent2abfa07acf4f44056d28eeb68dc2d6b3b63341ab (diff)
calloc, from peter malone
-rw-r--r--usr.bin/pkill/pkill.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c
index de908d79a84..df349bb0980 100644
--- a/usr.bin/pkill/pkill.c
+++ b/usr.bin/pkill/pkill.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pkill.c,v 1.34 2013/11/12 13:54:51 deraadt Exp $ */
+/* $OpenBSD: pkill.c,v 1.35 2014/05/07 01:27:42 tedu Exp $ */
/* $NetBSD: pkill.c,v 1.5 2002/10/27 11:49:34 kleink Exp $ */
/*-
@@ -277,9 +277,8 @@ main(int argc, char **argv)
* Allocate memory which will be used to keep track of the
* selection.
*/
- if ((selected = malloc(nproc)) == NULL)
+ if ((selected = calloc(nproc, 1)) == NULL)
errx(STATUS_ERROR, "memory allocation failure");
- memset(selected, 0, nproc);
/*
* Refine the selection.