On Fri, 2011-11-04 at 11:55 +0100, Jakub Hrozek wrote:
> On Fri, Nov 04, 2011 at 11:43:02AM +0100, Jan Zeleny wrote:
> > Jakub Hrozek <jhrozek(a)redhat.com> wrote:
> > > On Fri, Nov 04, 2011 at 09:24:55AM +0100, Jan Zeleny wrote:
> > > >
https://fedorahosted.org/sssd/ticket/1069
> > > >
https://fedorahosted.org/sssd/ticket/1071
> > > >
> > > > --
> > > > Jan
> > >
> > > 001: ack
> > > 002: nack, if talloc_asprintf() failed, close() would attempt to
> > > close a random-valued fd
> >
> > Ah, you're right. Similar situation would occur if open() failed.
> >
> > The second round of patches attached
> >
> > Jan
>
> It would be more readable to initialize fd to -1 or any value < 0 and
> only close if (fd != -1) but this works too, I guess.
I'm going to say that Jakub's suggestion justifies a nack. It would be
much better going forward if we just initialized to -1 and had the
'fail' label simply check for (fd >= 0)
Agreed. Sending corrected patch.
Jan