aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/killall
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2012-06-30 16:20:01 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2012-06-30 16:20:01 +0000
commit40bcb503f1a8b9885072a7dc1cb41c2cc462469c (patch)
treeb786db6aaf84305e7d376390cc4f1f5a92c39001 /usr.bin/killall
parent5f42fa17939a6b4b4ee58ae0bd913101bee2f898 (diff)
Notes
Diffstat (limited to 'usr.bin/killall')
-rw-r--r--usr.bin/killall/killall.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/killall/killall.c b/usr.bin/killall/killall.c
index 89db399ed684..4a1d2b02b180 100644
--- a/usr.bin/killall/killall.c
+++ b/usr.bin/killall/killall.c
@@ -90,7 +90,7 @@ nosig(char *name)
int
main(int ac, char **av)
{
- struct kinfo_proc *procs = NULL, *newprocs;
+ struct kinfo_proc *procs, *newprocs;
struct stat sb;
struct passwd *pw;
regex_t rgx;
@@ -292,14 +292,14 @@ main(int ac, char **av)
miblen = 4;
}
+ procs = NULL;
st = sysctl(mib, miblen, NULL, &size, NULL, 0);
do {
size += size / 10;
newprocs = realloc(procs, size);
- if (newprocs == 0) {
- if (procs)
- free(procs);
- errx(1, "could not reallocate memory");
+ if (newprocs == NULL) {
+ free(procs);
+ err(1, "could not reallocate memory");
}
procs = newprocs;
st = sysctl(mib, miblen, procs, &size, NULL, 0);