summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-08-22 17:06:59 +0000
committerderaadt <deraadt@openbsd.org>1997-08-22 17:06:59 +0000
commitca09d1cd0f338cf20f5d9b5b7d3b269053fd8e25 (patch)
tree252f56251464f7f2650deb7674be6297a98888b2 /lib/libc/stdlib/malloc.c
parent"ln -s" becomes "ln -sf" (diff)
downloadwireguard-openbsd-ca09d1cd0f338cf20f5d9b5b7d3b269053fd8e25.tar.xz
wireguard-openbsd-ca09d1cd0f338cf20f5d9b5b7d3b269053fd8e25.zip
malloc_init() should try to not modify errno
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r--lib/libc/stdlib/malloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 9d9c69ad00c..12cc67083da 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.27 1997/07/02 16:26:27 millert Exp $";
+static char rcsid[] = "$OpenBSD: malloc.c,v 1.28 1997/08/22 17:06:59 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -478,6 +478,7 @@ malloc_init ()
{
char *p, b[64];
int i, j;
+ int save_errno = errno;
THREAD_LOCK_INIT();
@@ -584,7 +585,7 @@ malloc_init ()
* We can sbrk(2) further back when we keep this on a low address.
*/
px = (struct pgfree *) imalloc (sizeof *px);
-
+ errno = save_errno;
}
/*