all memory is recovered when a process ends... so technically you could get away with not freeing the memory, but its considered extremely bad practice; instead, make it a habit to free all resources you use (memory, files, sockets, devices, etc) before exiting. (you might find this tedious at first, but really, the only thing that separates a good C programmer from a bad one is discipline.) that is, unless you know the resource is garbage collected, like for gtk.
|