summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>2001-05-15 19:37:55 +0000
committermickey <mickey@openbsd.org>2001-05-15 19:37:55 +0000
commit04e8749f23035a05c1cf1c3ffa6faacc835efb4c (patch)
tree426f2a9d046fb98b26131ec61dd3f2484840acd5
parenterror out if failed to malloc memory for inode cache entry; deraadt@ ok (diff)
downloadwireguard-openbsd-04e8749f23035a05c1cf1c3ffa6faacc835efb4c.tar.xz
wireguard-openbsd-04e8749f23035a05c1cf1c3ffa6faacc835efb4c.zip
do the same as _ffs
-rw-r--r--sbin/fsck_ext2fs/inode.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/fsck_ext2fs/inode.c b/sbin/fsck_ext2fs/inode.c
index 2d50031ba6e..c3bd1179b81 100644
--- a/sbin/fsck_ext2fs/inode.c
+++ b/sbin/fsck_ext2fs/inode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inode.c,v 1.6 2000/04/26 23:26:06 jasoni Exp $ */
+/* $OpenBSD: inode.c,v 1.7 2001/05/15 19:37:55 mickey Exp $ */
/* $NetBSD: inode.c,v 1.1 1997/06/11 11:21:49 bouyer Exp $ */
/*
@@ -42,7 +42,7 @@ static char sccsid[] = "@(#)inode.c 8.5 (Berkeley) 2/8/95";
#if 0
static char rcsid[] = "$NetBSD: inode.c,v 1.1 1997/06/11 11:21:49 bouyer Exp $";
#else
-static char rcsid[] = "$OpenBSD: inode.c,v 1.6 2000/04/26 23:26:06 jasoni Exp $";
+static char rcsid[] = "$OpenBSD: inode.c,v 1.7 2001/05/15 19:37:55 mickey Exp $";
#endif
#endif
#endif /* not lint */
@@ -409,8 +409,10 @@ cacheino(dp, inumber)
blks = NDADDR + NIADDR;
inp = (struct inoinfo *)
malloc(sizeof(*inp) + (blks - 1) * sizeof(daddr_t));
- if (inp == NULL)
+ if (inp == NULL) {
+ errexit("cannot malloc inode cache entry\n");
return;
+ }
inpp = &inphead[inumber % numdirs];
inp->i_nexthash = *inpp;
*inpp = inp;