From d4dffe762255324e34fe4af75353a03e0ad95603 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 10 Sep 2011 16:50:47 +0200 Subject: [PATCH] kill: fix issue warned by smatch misc-utils/procs.c +82 get_pids(52) error: potential null derefence 'pids'. Signed-off-by: Sami Kerola --- misc-utils/procs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc-utils/procs.c b/misc-utils/procs.c index 3f52387de7..7bbe02fe11 100644 --- a/misc-utils/procs.c +++ b/misc-utils/procs.c @@ -23,6 +23,7 @@ #include #include #include "kill.h" +#include "xalloc.h" extern char *mybasename (char *); static char *parse_parens (char *buf); @@ -77,7 +78,7 @@ get_pids (char *process_name, int get_all) { if (strcmp (process_name, mybasename (cp))) continue; while (pids_size < num_pids + 2) { pids_size += 5; - pids = (int *) realloc (pids, sizeof (int) * pids_size); + pids = (int *) xrealloc (pids, sizeof (int) * pids_size); } pids[num_pids++] = pid; pids[num_pids] = -1; -- 2.47.3