From the free man page
void free(void *ptr);
The free () function frees the memory allocation pointed to by PTR. If ptr is a NULL pointer, the operation is not performed.
If you want to receive confirmation directly from the C manual
A free function forces the space indicated by ptr to be freed, i.e. available for further distribution. If ptr is a null pointer, no action occurs.
See page 313 of this document.
source share