cURL / Mailing Lists / curl-library / Single Mail

curl-library

Corrupted CURLOPT_DEBUGDATA on calling curl_easy_cleanup() with FTP

From: Andrea Narciso <andrea.narciso_at_artgroup-srl.it>
Date: Fri, 23 Mar 2012 13:04:10 +0100

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?

Regards,
Andrea

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