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.
1.4m articles
1.4m replys
5 comments
57.0k users