diff options
-rw-r--r-- | lib/libc/stdlib/malloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 1743e20a894..f3f0a97c3a7 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.119 2009/11/27 19:59:49 otto Exp $ */ +/* $OpenBSD: malloc.c,v 1.120 2009/11/27 20:05:03 otto Exp $ */ /* * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net> * @@ -520,6 +520,8 @@ map(struct dir_info *d, size_t sz, int zero_fill) d->free_regions_size -= psz; if (zero_fill) memset(p, 0, sz); + else if (mopts.malloc_junk && mopts.malloc_freeprot) + memset(p, SOME_FREEJUNK, sz); return p; } p = MMAP(sz); |