mirror of
https://github.com/cryb-to/cryb-to.git
synced 2025-01-18 09:41:10 +00:00
Ignore free(NULL) instead of treating it the same as free(malloc(0)).
This commit is contained in:
parent
1f0fd8d9fe
commit
a587a25d45
1 changed files with 4 additions and 0 deletions
|
@ -404,6 +404,10 @@ free(void *p)
|
||||||
|
|
||||||
UTRACE_FREE(p);
|
UTRACE_FREE(p);
|
||||||
|
|
||||||
|
/* free(NULL) */
|
||||||
|
if (p == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* was this a zero-size allocation? */
|
/* was this a zero-size allocation? */
|
||||||
if (p == buckets[0].base) {
|
if (p == buckets[0].base) {
|
||||||
++buckets[0].nfree;
|
++buckets[0].nfree;
|
||||||
|
|
Loading…
Reference in a new issue