cURL / Mailing Lists / curl-library / Single Mail

curl-library

Memory leak

From: Vijay <nags.vijay_at_gmail.com>
Date: Tue, 21 Oct 2008 16:36:04 +0530

For each and every http query am using a new connection,
So what am doing in my code is

      //Close the connection
      curl_easy_cleanup(m_ptrCurl);
      //curl_free(m_ptrCurl);
      curl_global_cleanup();
      //Reinitialize for next request in advace anyway connection wont be
      //created unless new request comes
      ReInitialize();

In Reinitalize am doing
if (CURL_OPERATION_OK != curl_global_init(CURL_GLOBAL_ALL))
   {
      LogClient::GetInstance()->Log(LOG_CATEGORY_ERROR,"LibCurl global
initialization failed. so exiting ");
      return HTTPAGENT_FAILURE;
   }

   m_ptrCurl = curl_easy_init();

   if(NULL == m_ptrCurl)
   {
      LogClient::GetInstance()->Log(LOG_CATEGORY_ERROR,"LibCurl easy
initialization failed. so exiting ");
      return HTTPAGENT_FAILURE;

   }
Will it cause any memory leak.

Because of these am getting memory leak in my code.
Suggest me what to do
Received on 2008-10-21