summaryrefslogtreecommitdiff
path: root/rts/linker/M32Alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/linker/M32Alloc.c')
-rw-r--r--rts/linker/M32Alloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rts/linker/M32Alloc.c b/rts/linker/M32Alloc.c
index 6f61a5c447..1a19df8471 100644
--- a/rts/linker/M32Alloc.c
+++ b/rts/linker/M32Alloc.c
@@ -317,7 +317,9 @@ void m32_allocator_free(m32_allocator *alloc)
/* free partially-filled pages */
const size_t pgsz = getPageSize();
for (int i=0; i < M32_MAX_PAGES; i++) {
- munmapForLinker(alloc->pages[i], pgsz);
+ if (alloc->pages[i]) {
+ munmapForLinker(alloc->pages[i], pgsz);
+ }
}
stgFree(alloc);