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-1780194 ] memory leak if proxy empty string

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 23 Aug 2007 06:04:09 -0700

Bugs item #1780194, was opened at 2007-08-23 15:04
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=1780194&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: libcurl
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ivosh (iraisr)
Assigned to: Daniel Stenberg (bagder)
Summary: memory leak if proxy empty string

Initial Comment:
In libcurl version 7.16.2, there is a memory leak in CreateConnection function (url.c module) if data->set.proxy is an empty string.

On line 2969, proxy gets its content via strdup().
On line 3365 the test fails because (proxy != NULL) && (*proxy == '\0').
But proxy is not freed anywhere below.
I fixed the leak by adding the following at line 3478:
  else if (proxy != NULL) {
      free(proxy);
      proxy = NULL;
  }

But I think better logic will be not to call strdup for proxy at all. In this case also logic on line 2982 needs to be altered (because data->set.proxy specified an empty proxy).

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

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

These mail archives are generated by hypermail.

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

File upload with ASP.NET