- 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

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