if malloc can return 0 on a 0 argument, free should also accept 0
This commit is contained in:
parent
4b445d4860
commit
cccb0dd197
|
@ -152,7 +152,13 @@ malloc(n)
|
||||||
free(addr)
|
free(addr)
|
||||||
char *addr;
|
char *addr;
|
||||||
{check_mallinks("free entry");{
|
{check_mallinks("free entry");{
|
||||||
register mallink *ml = mallink_of_block(addr);
|
register mallink *ml;
|
||||||
|
|
||||||
|
if (addr == 0) {
|
||||||
|
check_mallinks("free(0) very fast exit");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ml = mallink_of_block(addr);
|
||||||
|
|
||||||
#ifdef STORE
|
#ifdef STORE
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue