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
This commit is contained in:
Dag-Erling Smørgrav 2008-01-23 20:57:59 +00:00
parent 73e9aa89e8
commit b2a9c5a1ba

View file

@ -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);
}