Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Check malloc failure.
details: https://anonhg.NetBSD.org/src/rev/77752bae003c
branches: trunk
changeset: 485975:77752bae003c
user: enami <enami%NetBSD.org@localhost>
date: Wed May 10 02:16:15 2000 +0000
description:
Check malloc failure.
diffstat:
sys/kern/kern_subr.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diffs (18 lines):
diff -r 0ed83a9a9ff8 -r 77752bae003c sys/kern/kern_subr.c
--- a/sys/kern/kern_subr.c Wed May 10 02:14:41 2000 +0000
+++ b/sys/kern/kern_subr.c Wed May 10 02:16:15 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_subr.c,v 1.65 2000/05/10 02:14:41 enami Exp $ */
+/* $NetBSD: kern_subr.c,v 1.66 2000/05/10 02:16:15 enami Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -232,6 +232,8 @@
for (hashsize = 1; hashsize < elements; hashsize <<= 1)
continue;
hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, flags);
+ if (hashtbl == NULL)
+ return (NULL);
for (i = 0; i < hashsize; i++)
LIST_INIT(&hashtbl[i]);
*hashmask = hashsize - 1;
Home |
Main Index |
Thread Index |
Old Index