cURL / Mailing Lists / curl-library / Single Mail


strange mem behavior

From: Devel <>
Date: Wed, 24 May 2006 18:02:44 +0200

Hi all,
i have this function in my app SDL based. For test i call this function in a loop while. Using top cmd (i'm using linux) i see that VIRT mem associated with my apps grow every time i call curl_easy_perform and it doesn't relased with curl_easy_perform.
Can you help me to debug this?

int netcam_get (int index)
        CURL *curl=NULL;
        CURLcode ret;
        FILE *jpegfile;
        char *filename="/tmp/tmp.jpg";
        char userpass[40];
        char url[300];
        char ctrl_str[300];
// char error_buf[CURL_ERROR_SIZE];

        if ((jpegfile=fopen(filename,"w"))==NULL)
                return -1;
        if (curl) {
                        curl_easy_setopt(curl,CURLOPT_VERBOSE, 1);
                curl_easy_setopt(curl,CURLOPT_CONNECTTIMEOUT, 10);
                curl_easy_setopt(curl,CURLOPT_TIMEOUT, 30);
                curl_easy_setopt(curl,CURLOPT_NOSIGNAL, 1);
                curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
                curl_easy_setopt(curl, CURLOPT_FILE, jpegfile);
                curl_easy_setopt(curl, CURLOPT_URL, url);
                if (strcmp(userpass,":"))
                        curl_easy_setopt(curl, CURLOPT_USERPWD, userpass);
                                log2f("Nessuna password assegnata",NULL,NULL,NULL,verbose);

                if (ret!=0) {
                                case CURLE_COULDNT_CONNECT:
                                        log2f("next_cam()- Non posso connettermi all'url:",url,curl_easy_strerror(ret),NULL,verbose);
                                        log2f("Error getting netcam image:",curl_easy_strerror(ret),NULL,NULL,verbose);
                                return -1;
        return 0;
Received on 2006-05-24