From: Sami Kerola Date: Sat, 10 Sep 2011 14:50:47 +0000 (+0200) Subject: kill: fix issue warned by smatch X-Git-Tag: v2.21-rc1~431^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4dffe762255324e34fe4af75353a03e0ad95603;p=thirdparty%2Futil-linux.git kill: fix issue warned by smatch misc-utils/procs.c +82 get_pids(52) error: potential null derefence 'pids'. Signed-off-by: Sami Kerola --- 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;