misc-utils/procs.c +82 get_pids(52) error: potential null derefence 'pids'.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
#include <ctype.h>
#include <unistd.h>
#include "kill.h"
+#include "xalloc.h"
extern char *mybasename (char *);
static char *parse_parens (char *buf);
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;