cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Corrupted CURLOPT_DEBUGDATA on calling curl_easy_cleanup() with FTP

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 23 Mar 2012 23:10:41 +0100 (CET)

On Fri, 23 Mar 2012, Andrea Narciso wrote:

> I'm using libcurl to implement an FTP client. I hooked a custom debug
> handler to the library using CURLOPT_DEBUGFUNCTION as follows:
>
> curl_easy_setopt(m_CurlHandle, CURLOPT_VERBOSE, 1L);
> curl_easy_setopt(m_CurlHandle, CURLOPT_DEBUGFUNCTION, MyDebugHandler);
> curl_easy_setopt(m_CurlHandle, CURLOPT_DEBUGDATA, &myData);
>
> During normal operations (file transfer, navigation etc.) this is working
> fine.
>
> When I shut down the connection using curl_easy_cleanup(), MyDebugHandler()
> gets called with an invalid pointer to myData, so my application crashes
> when it tries to use it.
>
> Is this a bug or am I doing something wrong?

Hi, and thanks a lot for reporting this problem!

Any chance you can write up an example source code for us that we can use to
repeat this problem and see if it is a bug and if so, what we can do about it
to make it go away?

--
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-23