Here's some pseudocode that demonstrates why free is important:

while (condition) {    // a looping construct in which "name" gets reused
     strcpy(name,input);             // the new content
     (use name, etc.)
This will work fine without free(), but every time you call malloc, MORE memory is allocated and the pointer is reassigned to this new, unused chunk. If "name" was pointing to a string in memory, that previous chunk of memory is preserved as part of the program, but there is no longer a pointer to it so it's just wasted and unusable. By calling free() at the end of the loop, the space occupied by the data pointed to by "name" is returned to the heap, since we are done using it. This way, the amount of memory consumed may change depending on the strlen of "input", but it will not accumulate with each iteration of the loop (10 bytes + 12 bytes + 8 bytes, and so on) which would be a "memory leak" since the memory you are losing remains held by the process but cannot be used because it has no pointer.