Make ``df -l'' work when no network filesystems are loaded.

PR:		bin/32397
This commit is contained in:
Ruslan Ermilov 2001-12-19 08:38:02 +00:00
parent a9c9684163
commit cf5b29e126

View File

@ -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);
}