- Justin Fletcher fixed a file descriptor leak in the curl tool when trying to

upload a file it couldn't open. Bug #1676581
  (http://curl.haxx.se/bug/view.cgi?id=1676581)
This commit is contained in:
Daniel Stenberg 2007-03-09 21:51:38 +00:00
parent 1962ebf8e7
commit 3789e2e6ce
3 changed files with 8 additions and 1 deletions

View File

@ -6,6 +6,11 @@
Changelog
Daniel (9 March 2007)
- Justin Fletcher fixed a file descriptor leak in the curl tool when trying to
upload a file it couldn't open. Bug #1676581
(http://curl.haxx.se/bug/view.cgi?id=1676581)
Dan F (9 March 2007)
- Updated the test harness to check for protocol support before running each
test, fixing KNOWN_BUGS #11.

View File

@ -58,6 +58,6 @@ advice from friends like these:
Yang Tse, Manfred Schwarb, Michael Wallner, Jeff Pohlmeyer, Shmulik Regev,
Rob Crittenden, Robert A. Monat, Dan Fandrich, Duncan Mac-Vicar Prett,
Michal Marek, Robson Braga Araujo, Ian Turner, Linus Nielsen Feltzing,
Ravi Pratap, Adam D. Moss, Jose Kahan, Hang Kin Lau
Ravi Pratap, Adam D. Moss, Jose Kahan, Hang Kin Lau, Justin Fletcher
Thanks! (and sorry if I forgot to mention someone)

View File

@ -3931,6 +3931,8 @@ operate(struct Configurable *config, int argc, char *argv[])
infd=(FILE *) fopen(uploadfile, "rb");
if (!infd || stat(uploadfile, &fileinfo)) {
helpf("Can't open '%s'!\n", uploadfile);
if(infd)
fclose(infd);
return CURLE_READ_ERROR;
}
infdfopen=TRUE;