aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/malloc.c')
-rw-r--r--src/runtime/malloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/malloc.c b/src/runtime/malloc.c
index 744e1222b7..1d3c8b958b 100644
--- a/src/runtime/malloc.c
+++ b/src/runtime/malloc.c
@@ -68,6 +68,9 @@ free(void *v)
MSpan *s;
MCache *c;
+ if(v == nil)
+ return;
+
// Find size class for v.
page = (uintptr)v >> PageShift;
sizeclass = MHeapMapCache_GET(&mheap.mapcache, page, tmp);