aboutsummaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
Diffstat (limited to 'compat')
-rw-r--r--compat/mmap-blob.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/compat/mmap-blob.c b/compat/mmap-blob.c
index 3626cc7..1cab4de 100644
--- a/compat/mmap-blob.c
+++ b/compat/mmap-blob.c
@@ -29,5 +29,9 @@ void blob_free(void *addr, unsigned long size)
{
if (!size || (size & ~CHUNK) || ((unsigned long) addr & 512))
die("internal error: bad blob free (%lu bytes at %p)", size, addr);
+#ifndef DEBUG
munmap(addr, size);
+#else
+ mprotect(addr, size, PROT_NONE);
+#endif
}