From ee26f2605a927ed8d74b22b858709c5c35a59088 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Thu, 28 Apr 2016 22:16:51 +1000 Subject: [PATCH] killall: fix malloc branch logic for pgid A fix to remove some spurious code removed a branch and an else but did not invert the if check like it should. It meant if process groups were used the spaces was not allocated. References: commit 1fcc2b17ab8e88a023d3cd38057e9a5fe93d7313 --- src/killall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/killall.c b/src/killall.c index 9f9a74d..5b3315e 100644 --- a/src/killall.c +++ b/src/killall.c @@ -463,7 +463,7 @@ kill_all (int signal, int name_count, char **namelist, struct passwd *pwent) perror ("malloc"); exit (1); } - if (!process_group) + if (process_group) { pgids = calloc (pids, sizeof (pid_t)); if (!pgids) @@ -653,6 +653,7 @@ kill_all (int signal, int name_count, char **namelist, struct passwd *pwent) free(pid_killed); free(pid_table); free(command); + free(name_info); return error; } -- 2.50.1