I have this program which stores lots of stuff in memory via pointers to memory areas (structures, arrays), and this user that can init the program at anytime. Upon init, the program needs to free previously used memory (if any, and that's the catch) and allocate new storage with a possibly different size.
Now upon the very first init I have no idea what my pointers are pointing at: especially, I don't know if they are garbage or not. Yet in case they aren't, I need to free what they are pointing at. How do I know?