[PATCH weston 2/2] main: don't leak option strings

Daniel Stone daniel at fooishbar.org
Tue Sep 9 04:32:09 PDT 2014


On 9 September 2014 07:49, Pekka Paalanen <ppaalanen at gmail.com> wrote:

> On Mon, 08 Sep 2014 11:00:37 -0700
> Bill Spitzak <spitzak at gmail.com> wrote:
> > On 09/07/2014 11:28 PM, Pekka Paalanen wrote:
> > Trying to shut up valgrind on exit is an exercise in futility and adding
> > a free() to try to shut it up often requires lots of unwanted code
> > changes as this demonstrates.
> Yes, there are at least two schools on that. Some say, that a one-time
> allocation cannot be a leak. That is true, but only as long as it stays
> a one-time allocation. Guaranteeing that is the hard part.
> I prefer plugging all reports that can be plugged without corner-case
> bugs, so that actual leaks do not get hidden between these. It is very
> frustrating to analyze Valgrind reports just to create a suppressions
> file so that I might see only the real leaks.

Yes, this. If Valgrind isn't instantly and immediately usable, no-one will
use it: much like there are no gcc warnings which are 'fine' to have, since
they just hide all the real ones.

> I also favour consistency in coding style. We code all "normal"
> functions to not leak, so why not main(), too.

And if/when libweston becomes a thing, there will be no 'normal' functions.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20140909/c96fffbe/attachment.html>

More information about the wayland-devel mailing list