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: Fri, 09 Mar 2007 13:51:47 -0800

Bugs item #1676581, was opened at 2007-03-08 16:06
Message generated for change (Comment added) made by bagder
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: client module
Group: bad behaviour
>Status: Closed
>Resolution: Accepted
>Priority: 6
Private: No
Submitted By: Justin Fletcher (gerph)
>Assigned to: Daniel Stenberg (bagder)
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.

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

>Comment By: Daniel Stenberg (bagder)
Date: 2007-03-09 22:51

Message:
Logged In: YES
user_id=1110
Originator: NO

Thanks, applied just now!

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

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

These mail archives are generated by hypermail.

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

File upload with ASP.NET