This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Releasing memory before the program terminates. (Was: patch: Make sort-test handle more then 100 lines, and avoid segfault)
[Ulrich Drepper]
> Just one thing: not freeing memory before it terminates is no memory
> leak. It is usually stupid to do this since it unnecessarily slows
> down the program.
I partly agree, but prefer to always release the memory because one
never where the code will be used later. It might end up in a
library, or as an example for unskilled programmers. In this case, I
added the code to avoid warnings from valgrind. Getting rid of this
noise made it easier to see real problems with the code.