Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Aug 2003 09:17:23 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        Dag-Erling Smorgrav <des@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libfetch ftp.c
Message-ID:  <20030829091700.S43295@root.org>
In-Reply-To: <20030829091449.Y43295@root.org>
References:  <20030829155418.3786816A556@hub.freebsd.org> <20030829091449.Y43295@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 29 Aug 2003, Nate Lawson wrote:
> On Fri, 29 Aug 2003, Dag-Erling Smorgrav wrote:
> >   Modified files:
> >     lib/libfetch         ftp.c
> >   Log:
> >   Don't close a FILE * which we know is bogus.
> >
> >   Revision  Changes    Path
> >   1.89      +0 -1      src/lib/libfetch/ftp.c
> >
> > --- src/lib/libfetch/ftp.c:1.88	Tue Aug 19 04:43:11 2003
> > +++ src/lib/libfetch/ftp.c	Fri Aug 29 08:54:12 2003
> > @@ -1006,7 +1006,6 @@
> >  	f = _ftp_request(url, "STAT", us, _ftp_get_proxy(flags), flags);
> >  	if (f == NULL)
> >  		return (-1);
> > -	fclose(f);
> >  	return (0);
> >  }
> >
>
> Are you sure that's bogus?  According to a quick glance at _ftp_request(),
> it returns NULL on error, which should exit you out with the return(-1),
> never calling the fclose() in the error case.

Never mind, I just saw the special case for STAT:
                return (FILE *)1; /* bogus return value */

Yick.

-Nate



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