Haxx ad

curl's project page on


cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

Re: Memory leak in libcurl

From: Huzaifa Al Nahas <>
Date: Mon, 22 Dec 2008 10:59:56 -0800

Hi Dan,
The memory leak is reported even if curl_global_cleanup() is called.
This is true whether I call curl_global_init directly or indirectly.
The code below reports a memory leak

#include <iostream>
#include <curl/curl.h>
#include <crtdbg.h>


int main(int argc, char *argv[])
  CURL *curl;


  curl = curl_easy_init();



  if (_CrtDumpMemoryLeaks())
          std::cout << "Memory Leak" << std::endl;
          std::cout << "No memory leak found" << std::endl;

  return 0;

- Huzaifa

On Fri, Dec 19, 2008 at 10:34 PM, Dan Fandrich <> wrote:
> On Fri, Dec 19, 2008 at 07:45:13PM -0800, Huzaifa Al Nahas wrote:
>> Greetings,
>> VC++ 8.0 is reporting a memory leak after curl cleans an easy handle.
>> Is this a known issue?
> curl_easy_init() implicitly calls curl_global_init() if you don't call the
> latter explicitly. You need to call curl_global_cleanup() explicitly to
> free memory allocated by it.
>>>> Dan
> --
> The web change of address service
> Let webmasters know that your web site has moved
Received on 2008-12-22

These mail archives are generated by hypermail.

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

File upload with ASP.NET