summaryrefslogtreecommitdiffstats
path: root/bin/ps/keyword.c
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-06-05 18:11:25 +0000
committerjmallett <jmallett@FreeBSD.org>2002-06-05 18:11:25 +0000
commite24090eb3a797e5f9a03d68354396bb36afd28f2 (patch)
tree47d7bd53bf4aaac82ddc54b2e48f0c474d954661 /bin/ps/keyword.c
parente11700e21ef6e32612bde060eef8120b23330acf (diff)
downloadFreeBSD-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.c4
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)
OpenPOWER on IntegriCloud