From: Russ Cox Date: Sat, 10 Jan 2009 00:22:13 +0000 (-0800) Subject: free(nil) X-Git-Tag: weekly.2009-11-06~2392 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0c3243053465e0e4482fb5040c2e4e16972751cc;p=gostls13.git free(nil) R=iant DELTA=3 (3 added, 0 deleted, 0 changed) OCL=22467 CL=22471 --- 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);