if malloc can return 0 on a 0 argument, free should also accept 0

This commit is contained in:
ceriel 1989-10-31 09:44:21 +00:00
parent 4b445d4860
commit cccb0dd197

View file

@ -152,7 +152,13 @@ malloc(n)
free(addr)
char *addr;
{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