summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortedu <>2003-10-15 21:37:01 +0000
committertedu <>2003-10-15 21:37:01 +0000
commit9c41a5aafdf165f4bfe54930f369850d9425f840 (patch)
tree4043f92b92a77bfbe018e98fe75b649879ab30fd /src/lib
parent933ce423a2232043a2b23fca4ea6883853e5bd3a (diff)
downloadopenbsd-9c41a5aafdf165f4bfe54930f369850d9425f840.tar.gz
openbsd-9c41a5aafdf165f4bfe54930f369850d9425f840.tar.bz2
openbsd-9c41a5aafdf165f4bfe54930f369850d9425f840.zip
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 'src/lib')
-rw-r--r--src/lib/libc/stdlib/malloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c
index b6762298a1..15feb6d2d3 100644
--- a/src/lib/libc/stdlib/malloc.c
+++ b/src/lib/libc/stdlib/malloc.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#if defined(LIBC_SCCS) && !defined(lint) 10#if defined(LIBC_SCCS) && !defined(lint)
11static char rcsid[] = "$OpenBSD: malloc.c,v 1.62 2003/10/02 00:02:10 tedu Exp $"; 11static char rcsid[] = "$OpenBSD: malloc.c,v 1.63 2003/10/15 21:37:01 tedu Exp $";
12#endif /* LIBC_SCCS and not lint */ 12#endif /* LIBC_SCCS and not lint */
13 13
14/* 14/*
@@ -177,7 +177,7 @@ static size_t malloc_ninfo;
177static struct pgfree free_list; 177static struct pgfree free_list;
178 178
179/* Abort(), user doesn't handle problems. */ 179/* Abort(), user doesn't handle problems. */
180static int malloc_abort; 180static int malloc_abort = 2;
181 181
182/* Are we trying to die ? */ 182/* Are we trying to die ? */
183static int suicide; 183static int suicide;
@@ -839,7 +839,7 @@ imalloc(size_t size)
839 else 839 else
840 result = malloc_pages(size); 840 result = malloc_pages(size);
841 841
842 if (malloc_abort && result == NULL) 842 if (malloc_abort == 1 && result == NULL)
843 wrterror("allocation failed\n"); 843 wrterror("allocation failed\n");
844 844
845 if (malloc_zero && result != NULL) 845 if (malloc_zero && result != NULL)