This is why you set a pointer to NULL after freeing it, so that you get a defined behavior. :-)