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?
From http://linux.die.net/man/3/malloc:
If ptr is NULL, no operation is performed.