aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-01-09 16:22:13 -0800
committerRuss Cox <rsc@golang.org>2009-01-09 16:22:13 -0800
commit0c3243053465e0e4482fb5040c2e4e16972751cc (patch)
tree669d6dbde2757b875439f0532f11bdaf0d2e7bdf /src
parenta3ed4e716a61ffc8cbaba6094b82832a37d74222 (diff)
downloadgo-0c3243053465e0e4482fb5040c2e4e16972751cc.tar.xz
free(nil)
R=iant DELTA=3 (3 added, 0 deleted, 0 changed) OCL=22467 CL=22471
Diffstat (limited to 'src')
-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);