The use of heap-allocated memory is definitely something you have to plan out ahead of time in a C or C++ program.
Part of it is because you have to avoid 'leaking' memory. When you don't deallocate things, you run out of heap and your program crashes.
The other part of it is because when you *do* deallocate things, any pointers to them that are still lying around elsewhere become deathtraps for your program. Any attempt to dereference a pointer to something that has been deallocated will cause either a subtle, random-seeming bug that makes no sense and generally can't be reproduced ever (if something else happens to have been allocated at the same place), or a not-very-subtle bug that crashes your program and is usually easy to reproduce(if something hasn't).
So it's worth it to be very very careful about pointers to heap-allocated objects. Have a plan. Know exactly what parts of the program are allowed to touch such pointers, know every place such a pointer can be stored, and know which stored pointers might still be around after the thing is deallocated. Have a strategy to avoid following those pointers, because they will lead your program only to its death.
Bear