summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-10-15 21:37:02 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-10-15 21:37:02 +0000
commit77ac78a622f37da316607f99d6333ac32d3bdad6 (patch)
treec9cfb3a9e243b8b2f00f59beb3a2565c20aa7c46 /lib
parent22bc5fbff8c6c5f8d2264ef59caa9da694bef12e (diff)
abort on errors by default. workaround so running out of memory isn't
actually an error, A still applies full effect. suggested by phk. ok deraadt@ tdeval@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/malloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index b6762298a19..15feb6d2d38 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -8,7 +8,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: malloc.c,v 1.62 2003/10/02 00:02:10 tedu Exp $";
+static char rcsid[] = "$OpenBSD: malloc.c,v 1.63 2003/10/15 21:37:01 tedu Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -177,7 +177,7 @@ static size_t malloc_ninfo;
static struct pgfree free_list;
/* Abort(), user doesn't handle problems. */
-static int malloc_abort;
+static int malloc_abort = 2;
/* Are we trying to die ? */
static int suicide;
@@ -839,7 +839,7 @@ imalloc(size_t size)
else
result = malloc_pages(size);
- if (malloc_abort && result == NULL)
+ if (malloc_abort == 1 && result == NULL)
wrterror("allocation failed\n");
if (malloc_zero && result != NULL)