As I was reading, there is a need to use
char word = "abc";
copy = (char*) malloc(sizeof(char) * (strlen(word) + 1));
free(), your pointer
copy still points to the same memory location.
free() does not actually delete what is written there in memory but rather tells the memory management that you do not need that part of memory anymore.
That is why it still outputs
abc. However, your OS could have reassigned that memory to another application or some new thing you allocate in your application. If you are unlucky, you will get an segmentation fault.