summaryrefslogtreecommitdiffstats
path: root/lib/libfetch
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2008-01-23 20:57:59 +0000
committerdes <des@FreeBSD.org>2008-01-23 20:57:59 +0000
commita0d60019afa3ab214dcb1edb63a7155f3279da5b (patch)
tree75bb7c380afe70e79c8c2fc6b1de0ca58878bb40 /lib/libfetch
parent2e7fd9ac9f18920862dfa2d22fd5f0ec5aa9a628 (diff)
downloadFreeBSD-src-a0d60019afa3ab214dcb1edb63a7155f3279da5b.zip
FreeBSD-src-a0d60019afa3ab214dcb1edb63a7155f3279da5b.tar.gz
Fix a regression introduced in rev 1.99: replace fclose(f) with a comment
explaining why f cannot possibly be a valid FILE * at this point. MFC after: 1 day
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/ftp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index 914f674..475adda 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -1181,7 +1181,11 @@ fetchStatFTP(struct url *url, struct url_stat *us, const char *flags)
f = ftp_request(url, "STAT", us, ftp_get_proxy(url, flags), flags);
if (f == NULL)
return (-1);
- fclose(f);
+ /*
+ * When op is "STAT", ftp_request() will return either NULL or
+ * (FILE *)1, never a valid FILE *, so we mustn't fclose(f) before
+ * returning, as it would cause a segfault.
+ */
return (0);
}
OpenPOWER on IntegriCloud