Can anyone summarize what is the correct usage of realloc()?
realloc()
What do you do when realloc() fails?
From what I have seen so far, it
From http://www.c-faq.com/malloc/realloc.html
If realloc cannot find enough space at all, it returns a null pointer, and leaves the previous region allocated.
Therefore you would indeed need to free the previously allocated memory still.