cURL / Mailing Lists / curl-library / Single Mail


Re: Crashing on curl_easy_cleanup(cur);

From: Daniel Stenberg <>
Date: Tue, 15 Oct 2002 13:58:56 +0200 (MET DST)

On Tue, 15 Oct 2002, Ben Helleman wrote:

> Hi there, I've been having issues when trying to use curl's
> curl_easy_cleanup(curl); What has been happening if I execute the
> following:

> ----------------
> CURL *curl;
> curl = curl_easy_init();
> curl_easy_setopt(curl, CURLOPT_URL, url); // url = "" for
> instance
> curl_easy_perform(curl);
> curl_easy_cleanup(curl); //************************
> ----------------
> the easy_cleanup(curl) crashes my execution.

So, are all the source examples crashing too then? This is the way to use
libcurl, and if curl_easy_cleanup() would crash this easily I would expect a
few more people than you would have come shouting here. I believe your
problem is trickier than this.

What libcurl version is this?

> If I remove the curl_easy_cleanup(curl); line the program runs fine.

Right, but leaks memory.

> I thought that each thread needs to clean itself up, so its best to call
> curl_easy_cleanup() after each thread's turn.

That's indeed the correct thing to do.

> Any suggestions what might be going on?

Something bugs! ;-)

> The above snippet of code is located in a function outside of main. In my
> main I perform: curl_global_init(CURL_GLOBAL_WIN32); and after all threads
> have joined I do a curl_global_cleanup();

Can please provide us with an as tiny program as possible that still repeats
this problem? Just the bare essentials.

Also, it always help if you can tell us what operating system you're using
and possibly which compiler and other facts you think might be interesting

 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
This email is sponsored by:ThinkGeek
Welcome to geek heaven.
Received on 2002-10-15