diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-23 05:45:14 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-23 05:45:14 +0000 |
commit | ac376f3391e54a39ad3727967e920e2dcd1703ae (patch) | |
tree | 28dbae4c12257486e0c9f0f08061dc818715a193 /sys | |
parent | 75ee6c031587752e6b201702ecb924885876179b (diff) |
Since malloc in hashinit can get M_NOWAIT flags, we should
check the return value.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_subr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 59550ac7940..4fd1742f18f 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_subr.c,v 1.16 2000/09/07 19:21:30 art Exp $ */ +/* $OpenBSD: kern_subr.c,v 1.17 2001/06/23 05:45:13 art Exp $ */ /* $NetBSD: kern_subr.c,v 1.15 1996/04/09 17:21:56 ragge Exp $ */ /* @@ -182,6 +182,8 @@ hashinit(elements, type, flags, hashmask) continue; hashsize >>= 1; 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; |