cURL / Mailing Lists / curl-library / Single Mail


curl_slist_free_all - doesn't free the list?

From: Admir Efendic <>
Date: Fri, 01 Apr 2005 06:28:15 +0200

Ok here is how I use it:

--------------------- snip ------------------------------------------
curl_easy_setopt(curl_handle, ...) - set different options

while(running) {
   struct curl_slist *headerlist = NULL;
   for(i=0;i<header_count;i++) {
       headerlist = curl_slist_append(headerlist, header[i]);
   curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headerlist);
   CURLcode res = curl_easy_perform(curl_handle);
--------------------- snip ------------------------------------------

But the header list keeps growing, when I look at the actual traffic.
First pass in while(running) loop, I get one header, then next pass, I
get two, pass after three headers, and so on.

I even tried adding:
curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, NULL);
after freeing the list, but to no effect.

/Admir Efendic
Received on 2005-04-01