cURL / Mailing Lists / curl-users / Single Mail


curl_slist_append segfault

From: Tim Johnson <>
Date: Mon, 29 Aug 2011 21:48:34 -0500

I've got an application where I'm using cURL in a C program. The general
flow is going about like this:

 struct curl_httppost *formpost=NULL;
 struct curl_httppost *lastptr=NULL;
 struct curl_slist *headerlist=NULL;
 static const char buf[] = "Expect:";


while (1)
   curl = curl_easy_init();
   headerlist = curl_slist_append(headerlist, buf);
    curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
    res = curl_easy_perform(curl);
    curl_slist_free_all (headerlist);

I've explicitly listed all functions that should be using headerlist.

On the second iteration through the loop, I get a segfault at the
curl_slist_append call. I'm hoping it's just something simple I'm doing. I
searched around, the only thing I saw that looked like this was an issue
that appeared to be fixed by a patch back in 2003. I'm linking against, which is a symlink to

Thanks for any help.


List admin:
Received on 2011-08-30