summaryrefslogtreecommitdiff
path: root/bin/df/df.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-05-11 15:06:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-05-11 15:06:52 +0000
commit7b2eefd2474ac6c1ee8b7f98d7177885d079bf46 (patch)
treef0f55c47ac47b7604f830a532e38371175512eef /bin/df/df.c
parent77354c85f02627af65e1f2819c5bb150a865ed7e (diff)
handle malloc failure; jan.niemann@tu-bs.de
Diffstat (limited to 'bin/df/df.c')
-rw-r--r--bin/df/df.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/df/df.c b/bin/df/df.c
index 54a260ada39..9efb5d2d08c 100644
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: df.c,v 1.43 2005/02/20 01:34:56 pedro Exp $ */
+/* $OpenBSD: df.c,v 1.44 2006/05/11 15:06:51 deraadt Exp $ */
/* $NetBSD: df.c,v 1.21.2.1 1995/11/01 00:06:11 jtc Exp $ */
/*
@@ -45,7 +45,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)df.c 8.7 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: df.c,v 1.43 2005/02/20 01:34:56 pedro Exp $";
+static char rcsid[] = "$OpenBSD: df.c,v 1.44 2006/05/11 15:06:51 deraadt Exp $";
#endif
#endif /* not lint */
@@ -141,6 +141,8 @@ main(int argc, char *argv[])
mntsize = regetmntinfo(&mntbuf, mntsize);
} else {
mntbuf = calloc(argc, sizeof(struct statfs));
+ if (mntbuf == NULL)
+ err(1, NULL);
mntsize = 0;
for (; *argv; argv++) {
if (stat(*argv, &stbuf) < 0) {