psmisc/psmisc-22.13-killall-pgid.patch

14 lines
397 B
Diff

diff --git a/src/killall.c b/src/killall.c
index 8b590c2..2550fc1 100644
--- a/src/killall.c
+++ b/src/killall.c
@@ -331,7 +331,7 @@ kill_all (int signal, int names, char **namelist, struct passwd *pwent)
pgids = NULL; /* silence gcc */
else
{
- pgids = malloc (pids * sizeof (pid_t));
+ pgids = calloc (pids, sizeof (pid_t));
if (!pgids)
{
perror ("malloc");