summaryrefslogtreecommitdiff
path: root/usr.bin/pkill
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/pkill')
-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.