For example:
char * myString = malloc(sizeof(char)*STRING_BUFFER_SIZE);
free(myString);
free(myString);
Are there any adverse side effects
Here's the chapter and verse.
If the argument [to the
freefunction] does not match a pointer earlier returned by thecalloc,malloc, orreallocfunction, or if the space has been deallocated by a call tofreeorrealloc, the behavior is undefined. (ISO 9899:1999 - Programming languages — C, Section 7.20.3.2)
Not so clever. Google for double free vulnerabilities. Set your pointer to NULL after freeing to avoid such bugs.