curl-users
Memory leak in curl
Date: Fri, 20 Aug 2004 11:23:36 +0100 (BST)
Hi,
I am using curl library version 7.10.5 for HTTP1.1
client functionality. I am receiving data received
from server in callback function. After I receive the
data I am trying to free it using curl_free fuction
but it gives me core dump. If I don't delete it I am
getting memory leak for that data.
This is the code for call back function which I have
written.
size_t ReadReply(void *buffer, size_t size, size_t
nmemb, void *userp)
{
m_strReply = new char[size*nmemb +1 ];
memset(m_strReply,0,size*nmemb);
memcpy(m_strReply,buffer,size*nmemb);
return size*nmemb;
}
How can I delete memory allocated for first parameter
in this function or curl do it for me?
I tried free_curl(buffer) it is giving me core dump.
Thanks in advance
Rupesh
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
Received on 2004-08-20