summaryrefslogtreecommitdiff
path: root/src/quarantine.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/quarantine.c')
-rw-r--r--src/quarantine.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/quarantine.c b/src/quarantine.c
index f96a948d..54315116 100644
--- a/src/quarantine.c
+++ b/src/quarantine.c
@@ -141,8 +141,17 @@ quarantine(void *ptr)
obj->usize = usize;
quarantine->curbytes += usize;
quarantine->curobjs++;
- if (opt_junk)
- memset(ptr, 0x5a, usize);
+ if (config_fill && opt_junk) {
+ /*
+ * Only do redzone validation if Valgrind isn't in
+ * operation.
+ */
+ if ((config_valgrind == false || opt_valgrind == false)
+ && usize <= SMALL_MAXCLASS)
+ arena_quarantine_junk_small(ptr, usize);
+ else
+ memset(ptr, 0x5a, usize);
+ }
} else {
assert(quarantine->curbytes == 0);
idalloc(ptr);