cvs commit: src/lib/libfetch ftp.c

Nate Lawson nate at root.org
Fri Aug 29 09:17:26 PDT 2003


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


More information about the cvs-src mailing list