I have a simple program which reads a bunch of ini file settings in memory allocated dynamically (malloc), then does stuff in loops for a long time, then ends. When I run valgrind I see that the memory I malloc'ed for my ini strings is not freed.
On the one hand, I think that it shouldn't matter since the program is shutting down (and no memory is leaked in the loops).
On the other hand, I like when valgrind gives me a big pat on the back for cleaning up my own mess. Aside from the pat on the back...is it good practice to release every malloc'ed space upon termination (or just let the OS cleanup)? If it is, how can I track which of my pointers point to malloc'ed memory (versus pointing to string constants which are the defaults) to ensure I'm releasing the right stuff?