From owner-cvs-all@FreeBSD.ORG Fri Aug 29 09:17:25 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E7C9516A4C0 for ; Fri, 29 Aug 2003 09:17:25 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 6DC6C43FF3 for ; Fri, 29 Aug 2003 09:17:23 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 43321 invoked by uid 1000); 29 Aug 2003 16:17:23 -0000 Date: Fri, 29 Aug 2003 09:17:23 -0700 (PDT) From: Nate Lawson To: Dag-Erling Smorgrav In-Reply-To: <20030829091449.Y43295@root.org> Message-ID: <20030829091700.S43295@root.org> References: <20030829155418.3786816A556@hub.freebsd.org> <20030829091449.Y43295@root.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libfetch ftp.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Aug 2003 16:17:26 -0000 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