[systemd-devel] [PATCH] login/sd-login.c: make use of _cleanup_free_ and friends
Lennart Poettering
lennart at poettering.net
Wed Apr 17 08:23:56 PDT 2013
On Wed, 17.04.13 16:30, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
>
> On Wed, Apr 17, 2013 at 04:25:40PM +0200, Lennart Poettering wrote:
> > On Wed, 17.04.13 16:12, harald at redhat.com (harald at redhat.com) wrote:
> >
> > > - char *root, *cgroup, *p, *cc;
> > > + char _cleanup_free_ *root = NULL, *cgroup = NULL, *p = NULL, *cc = NULL;
> >
> > Hmm, can we agree on a common syntax for this?
> >
> > I tend to put the "_cleanup_free_" before the type, and Zbigniew and
> > Harald after.
> >
> > I kinda prefer putting it first, since it puts the emphasis on the
> > cleanup logic, which I think is a good thing, since that's really
> > important to grok the code. i.e. the cleanup stuff is not unessential
> > decoration, but really important, so putting it first sounds good to me.
> >
> > _cleanup_free_ char *s = NULL;
> > char _cleanup_free_ char *t = NULL;
> >
> > I much prefer the first syntax...
> I don't care strongly, so I'm fine with putting it in front.
Cool. So Harald, please move the _cleanup_free_ to the front, and then
commit!
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list