diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-07-29 23:18:58 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-07-29 23:18:58 +0000 |
commit | 30094a9db7140c9545aec1635c4dd32ace2caa9d (patch) | |
tree | 522d178aa3b72079e71128aed7694b6f9fc7fb9c /sys | |
parent | 05dcea83fbbcf7835feb3819b1a88561621b0caa (diff) |
Try to gracefully handle out of memory conditions.
Not that it will help much, but what the hell.
noticed by: tedu <grendel@zeitbombe.org>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_userconf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/subr_userconf.c b/sys/kern/subr_userconf.c index d610c185a3f..cc8868ef18d 100644 --- a/sys/kern/subr_userconf.c +++ b/sys/kern/subr_userconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_userconf.c,v 1.30 2002/07/25 01:26:01 nordin Exp $ */ +/* $OpenBSD: subr_userconf.c,v 1.31 2002/07/29 23:18:57 art Exp $ */ /* * Copyright (c) 1996-2001 Mats O Jansson <moj@stacken.kth.se> @@ -505,6 +505,10 @@ userconf_change(devno) ; lk = l = (int *)malloc(sizeof(int) * i, M_TEMP, M_NOWAIT); + if (lk == NULL) { + printf("out of memory.\n"); + return; + } bcopy(cd->cf_loc, l, sizeof(int) * i); } |