diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-06-05 18:11:25 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-06-05 18:11:25 +0000 |
commit | e24090eb3a797e5f9a03d68354396bb36afd28f2 (patch) | |
tree | 47d7bd53bf4aaac82ddc54b2e48f0c474d954661 /bin/ps/keyword.c | |
parent | e11700e21ef6e32612bde060eef8120b23330acf (diff) | |
download | FreeBSD-src-e24090eb3a797e5f9a03d68354396bb36afd28f2.zip FreeBSD-src-e24090eb3a797e5f9a03d68354396bb36afd28f2.tar.gz |
Widen the scope of fmt.c::1.19 and consistently use errx(3) if malloc(3) [or
realloc(3)] happens to fail, everywhere in ps(1).
Discussed with: bde, charnier (a while ago)
fmt_argv() can no longer return NULL, so don't bother checking.
Submitted by: bde
Diffstat (limited to 'bin/ps/keyword.c')
-rw-r--r-- | bin/ps/keyword.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index f5724e0..8616757 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -247,10 +247,10 @@ parsefmt(const char *p) if (cp == NULL || !(v = findvar(cp))) continue; if ((vent = malloc(sizeof(struct varent))) == NULL) - err(1, NULL); + errx(1, "malloc failed"); vent->var = malloc(sizeof(*vent->var)); if (vent->var == NULL) - err(1, NULL); + errx(1, "malloc failed"); memcpy(vent->var, v, sizeof(*vent->var)); vent->next = NULL; if (vhead == NULL) |