Ignore free(NULL) instead of treating it the same as free(malloc(0)).

This commit is contained in:
Dag-Erling Smørgrav 2014-10-30 16:35:54 +00:00 committed by des
parent 1f0fd8d9fe
commit a587a25d45

View file

@ -404,6 +404,10 @@ free(void *p)
UTRACE_FREE(p);
/* free(NULL) */
if (p == NULL)
return;
/* was this a zero-size allocation? */
if (p == buckets[0].base) {
++buckets[0].nfree;