bug#79328: expr: memory not freed before program exit(memory leak)

Paul Eggert <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Organization UCLA Computer Science Department
Message-ID <[email protected]>
On 2025-08-28 01:08, Collin Funk wrote:
> Most (all?) of the programs in Coreutils will not free memory before
> exit, since it just takes extra time for no benefit.

Not only does it take extra time (and sometimes even space!), it makes 
the programs slightly less reliable because if there are bugs elsewhere 
the calls to 'free' can have undefined behavior. And this makes for more 
maintenance burden, since developers therefore have to verify that these 
other bugs cannot occur.

The idea that programmers ought to carefully free everything just before 
exit, merely to pacify a leak sanitizer, is misguided and counterproductive.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.