How can free () immediately after assigning NULL result in a dangling pointer?
2 answers
He can not.
It:
char * a = malloc(556);
char * b = a;
free(a);
a = NULL;
b now hangs a pointer because the object it pointed to but b
still stores the address in memory where the object used to be, you get funny results when you try to access it - it depends on whether it was reused or intact.
+14
a source to share