diff options
author | ru <ru@FreeBSD.org> | 2001-12-19 08:38:02 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-12-19 08:38:02 +0000 |
commit | 3145320d5808fab2aaa4d0dd7999119aeb51d3ae (patch) | |
tree | f805da797b391bc57f44ca244c965218627f4241 /bin | |
parent | d0b486460fe9e2066e22687a79cbb8620e86db31 (diff) | |
download | FreeBSD-src-3145320d5808fab2aaa4d0dd7999119aeb51d3ae.zip FreeBSD-src-3145320d5808fab2aaa4d0dd7999119aeb51d3ae.tar.gz |
Make ``df -l'' work when no network filesystems are loaded.
PR: bin/32397
Diffstat (limited to 'bin')
-rw-r--r-- | bin/df/df.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/df/df.c b/bin/df/df.c index 77c2d28..f244c26 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -548,8 +548,10 @@ makenetvfslist() } } - if ((str = malloc(sizeof(char) * (32 * cnt + cnt + 2))) == NULL) { - warnx("malloc failed"); + if (cnt == 0 || + (str = malloc(sizeof(char) * (32 * cnt + cnt + 2))) == NULL) { + if (cnt > 0) + warnx("malloc failed"); free(listptr); return (NULL); } |