diff --git a/lib/libc/malloc.c b/lib/libc/malloc.c index cd928e9c..df664409 100644 --- a/lib/libc/malloc.c +++ b/lib/libc/malloc.c @@ -112,6 +112,7 @@ void free(void *ap) { HEADER *p, *q; + if (!ap) return; p = (HEADER *) ap - 1; if (p->s.ptr != p)