summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2008-08-23 07:49:39 +0000
committerDamien Miller <djm@cvs.openbsd.org>2008-08-23 07:49:39 +0000
commit6f9398b097c437a2e59e019eb677450e778c9ecf (patch)
tree94c49431a2c1d976135c9b33d9a7e4283a743e58
parentc1a012e0a0b858899d01835d2c495252b6f1883d (diff)
unbreak MALLOC_OPTIONS=G that I broke in my last commit;
slightly kludgey solution for until otto fixes it properly; ok otto@
-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 711c8470efa..1cbe7fa0842 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.96 2008/08/23 06:15:16 djm Exp $ */
+/* $OpenBSD: malloc.c,v 1.97 2008/08/23 07:49:38 djm Exp $ */
/*
* Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
*
@@ -1078,14 +1078,14 @@ omalloc(size_t sz, int zero_fill)
errno = ENOMEM;
return NULL;
}
+ if (malloc_junk)
+ memset(p + sz, SOME_JUNK, psz - sz);
if (malloc_guard) {
if (mprotect((char *)p + psz - malloc_guard,
malloc_guard, PROT_NONE))
wrterror("mprotect");
malloc_guarded += malloc_guard;
}
- if (malloc_junk)
- memset(p + sz, SOME_JUNK, psz - sz - malloc_guard);
/* shift towards the end */
if (malloc_move &&