There is no point in freeing blocks at the end of a program, because all of the program’s space is given back to the system when the process terminates.
Remove free functions in end of files #1
Gnu1/slashtmp:remove_extra_free into master
All of these are just example code, not an actual program that will be used, so it's better for examples to be complete.
Beside, tomorrow someone else reading the code might think that free was mistakenly omitted and send another PR to add it back.
Also, you'll notice there's one instance of #ifdef DEBUG free() #endif. If these were actual programs, that is how I would deal with it.
In release build, there's no cost since the free calls gets removed. And in debug builds, it will satisfy runtime leak checkers and/or static analyzers. Furthermore, it signals to any human readers that the author didn't just forget to free, but it's an active choice to avoid free-ing in release builds, eliminating any possible confusion.
Pull request closed
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?