diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-06-05 01:36:30 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-06-05 01:36:30 +0000 |
commit | 6cb17fa895ac115ee28362d2d2fad8de9f5152db (patch) | |
tree | 86699739fb677b7a379456b60b3637a5533919c8 /bin | |
parent | b34dd0148dfb100764f5d568f50eb3cc4cfeb95d (diff) | |
download | FreeBSD-src-6cb17fa895ac115ee28362d2d2fad8de9f5152db.zip FreeBSD-src-6cb17fa895ac115ee28362d2d2fad8de9f5152db.tar.gz |
Returning NULL here if malloc(3) fails is silly, at this point in the codepath
we have't malloc(3)'d nearly as much as we probably will, so errx(3) away,
instead of waiting for something to fail yet again later on.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ps/fmt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c index c0c11f0..9263886 100644 --- a/bin/ps/fmt.c +++ b/bin/ps/fmt.c @@ -125,7 +125,7 @@ fmt_argv(char **argv, char *cmd, size_t maxlen) } cp = malloc(len); if (cp == NULL) - return (NULL); + errx(1, "malloc failed"); if (ap == NULL) sprintf(cp, " (%.*s)", (int)maxlen, cmd); else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0) |