What happens inside memory if we try to free a pointer which is pointing to NULL? Is that ever valid?
Why does it not show any warning/error messages?
It might be safe (I didn't know that, but the other answers seem to suggest that), but I won't fall into the habit of not caring about whether the pointer is already null. The assignment p = NULL; after every free soon follows as a corollary. This is dangerous in multithreaded applications, as after this assignment, p might be used by another thread and would be freed again by the current thread while it is expected to be alive by the other threads.
Every malloc'd memory should be freed once. Period.