summaryrefslogtreecommitdiff
path: root/lib/libc/gen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/getmntinfo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/gen/getmntinfo.c b/lib/libc/gen/getmntinfo.c
index 2d22f2fd424..ebdbfaa9d25 100644
--- a/lib/libc/gen/getmntinfo.c
+++ b/lib/libc/gen/getmntinfo.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getmntinfo.c,v 1.2 1996/08/19 08:23:45 tholo Exp $";
+static char rcsid[] = "$OpenBSD: getmntinfo.c,v 1.3 1999/01/08 11:09:21 art Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -60,8 +60,10 @@ getmntinfo(mntbufp, flags)
if (mntbuf)
free(mntbuf);
bufsize = (mntsize + 1) * sizeof(struct statfs);
- if ((mntbuf = (struct statfs *)malloc(bufsize)) == 0)
+ if ((mntbuf = (struct statfs *)malloc(bufsize)) == 0) {
+ bufsize = 0;
return (0);
+ }
if ((mntsize = getfsstat(mntbuf, bufsize, flags)) < 0)
return (0);
}