Releasing memory before the program terminates. (Was: patch: Make sort-test handle more then 100 lines, and avoid segfault)
Petter Reinholdtsen
pere@hungry.com
Wed Jul 16 07:41:00 GMT 2003
[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.
More information about the Libc-alpha
mailing list