Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jul 2001 12:28:15 -0400 (EDT)
From:      Mikhail Teterin <mi@aldan.algebra.com>
To:        dima@unixfreak.org
Cc:        kris@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.sbin/mailwrapper mailwrapper.c 
Message-ID:  <200107191628.f6JGSIO33402@aldan.algebra.com>
In-Reply-To: <20010719144945.0B1AA3E2F@bazooka.unixfreak.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 19 Jul, Dima Dorfman wrote:
> Mikhail Teterin <mi@aldan.algebra.com> writes:
>> On 18 Jul, Kris Kennaway wrote:
>> > kris        2001/07/18 22:04:46 PDT
>> > 
>> >   Modified files:        (Branch: RELENG_4)
>> >     usr.sbin/mailwrapper mailwrapper.c 
>> >   Log:
>> >   MFC: r1.6: You can't  free a string and then use  it as the error
>> >   message  to errx.  Instead use  warn  to print  the string,  then
>> >   cleanup and exit normally.
[...]
>> It was not there before, I  guess, because the "founding fathers" did
>> not concern  themselves with the  fate of the allocated  memory after
>> exit :-)
>
> Maybe  I'm missing  something, but  who cares  about allocated  memory
> *after* *exit*?

Well, may be *I* am missing something, but this seems to be the point of
the way Kris fixed  the problem -- the string was  beeing freed and then
passed to errx. Obviously wrong. Instead of just removing the free(), he
replaced the errx with warn (before the free()) and exit (after free()).

(Personally, I wouldn't  care either. I don't  think, it is a  sign of a
good programmer to care about this.)

	-mi



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107191628.f6JGSIO33402>