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 C99 section 7.20.3.2 : The free function
Synopsis
1 #include <stdlib.h> void free(void *ptr);
Description
2 The free function causes the space pointed to by ptr to be deallocated, that is, made available for further allocation. If ptr is a null pointer, no action occurs.
2.1m questions
2.1m answers
60 comments
57.0k users