summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Deval <tdeval@cvs.openbsd.org>2004-02-19 23:20:54 +0000
committerThierry Deval <tdeval@cvs.openbsd.org>2004-02-19 23:20:54 +0000
commit8e63928138ef00e1163db312474fbf69adfbf283 (patch)
tree739680125f8bfffb87819115c7e68a74b1e037de
parentcf359764764a3fc0d72d6c39d843095d880cfa9d (diff)
Sanity fix.
reviewed by deraadt@, tedu@
-rw-r--r--lib/libc/stdlib/malloc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 5a670423338..f5704754a0e 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.65 2003/11/19 02:27:18 tedu Exp $";
+static char rcsid[] = "$OpenBSD: malloc.c,v 1.66 2004/02/19 23:20:53 tdeval Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -1028,7 +1028,10 @@ free_pages(void *ptr, u_long index, struct pginfo *info)
madvise(ptr, l, MADV_FREE);
#endif
- l += malloc_guard;
+ if (malloc_guard) {
+ page_dir[index + i] = MALLOC_FREE;
+ l += malloc_guard;
+ }
tail = (char *)ptr+l;
if (malloc_freeprot)