Why did this code still work?
- by bstullkid
Some old code that I just came across:
MLIST * new_mlist_link()
{
MLIST *new_link = (MLIST * ) malloc(sizeof(MLIST));
new_link->next = NULL;
new_link->mapi = NULL;
new_link->result = 0;
}
This was being called to build a linked list, however I noticed there is no statement:
return new_link;
Even without the return statement there, the list still got built properly. Why did this happen?
EDT:
Platform: Mandriva 2009 64bit Linux 2.6.24.7-server GCC 4.2.3-6mnb1