cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1676581 ] file handle leak in the main tool

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 08 Mar 2007 07:06:18 -0800

Bugs item #1676581, was opened at 2007-03-08 15:06
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1676581&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: bad behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Justin Fletcher (gerph)
Assigned to: Nobody/Anonymous (nobody)
Summary: file handle leak in the main tool

Initial Comment:
Curl 7.16.1, src/main.c line 3909.

Currently:

if (!infd || stat(uploadfile, &fileinfo)) {
  helpf("Can't open '%s'!\n", uploadfile);
  return CURLE_READ_ERROR;
}

This should have the following inserted before the return in order to prevent a file handle leak :

  if (infd)
    fclose(infd);

In the case where the file has been opened, but cannot be stat'd, the file handle would have been leaked because the routine had returned without infd being closed, or infdfopen being set to TRUE.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1676581&group_id=976
Received on 2007-03-08

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET