Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/usr.sbin/arp



Robert Elz <kre%munnari.OZ.AU@localhost> writes:
>   |   i don't think so, it is a good practice to free() even if exit() will
>   |   take care of it.  there's no bad sideeffect.
> 
> It makes the code bigger, and wastes time for no purpose.   In this case
> that isn't particularly bad, but it isn't needed for anything either, and
> it isn't good practice to add any code that has no useful effect.
> 
> If you wanted to go down this road, then you really also need to get every
> program and make sure to fclose(stdin); fclose(stdout); fclose(stderr);
> just in case stdio allocated a buffer for one of those, so that buffer
> can be freed as well.
> 
> None of this kind of nonsense is needed, it accomplishes nothing.

"It depends" -- there are instances in which you're using automated
tools to assure that you don't have memory leaks and it is easier to
detect the real ones if you just free everything you allocate. In
general, though, I agree with you.

Perry



Home | Main Index | Thread Index | Old Index