cURL / Mailing Lists / curl-users / Single Mail

curl-users

Memory Leak?

From: Brian Feaver <bfeaver_at_divrsystems.com>
Date: Tue, 8 Oct 2002 09:56:37 -0700

I'm currently using version 7.10. I'm using cURL to download images from a
webserver continuously and then save them to disk. Everytime I want a new
image, I call curl_easy_perform (from inside an infinate loop). Here's a
snipit of my code:

curl_easy_setopt(curl,CURLOPT_URL,url);
curl_easy_setopt(curl,CURLOPT_USERPWD,userAndPassword);
curl_easy_setopt(curl,CURLOPT_NOPROGRESS,1);
curl_easy_setopt(curl,CURLOPT_VERBOSE,0);

while(true)
      {
         // Open file for writing
         jpgFile = fopen(jpgPath,"w");

         curl_easy_setopt(curl,CURLOPT_WRITEDATA,jpgFile);
         res = curl_easy_perform(curl);
         fclose(jpgFile);
         jpgFile = NULL;
      }

I have also tried putting all my cURL calls into its own function (including
a call to curl_easy_cleanup) and then just looping the funciton call. Both
of these ways cause the process to increase it's memory size. This is the
only part that repeats and therefor it can't be leaking anywhere else.

Any suggestions or hints would be appreciated.

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-10-08