1curl_slist_free_all(3) libcurl Manual curl_slist_free_all(3)
2
3
4
6 curl_slist_free_all - free an entire curl_slist list
7
9 #include <curl/curl.h>
10
11 void curl_slist_free_all(struct curl_slist *list);
12
14 curl_slist_free_all() removes all traces of a previously built
15 curl_slist linked list.
16
17 Passing in a NULL pointer in list will make this function return imme‐
18 diately with no action.
19
21 Nothing.
22
24 CURL *handle;
25 struct curl_slist *slist=NULL;
26
27 slist = curl_slist_append(slist, "X-libcurl: coolness");
28
29 if (slist == NULL)
30 return -1;
31
32 curl_easy_setopt(handle, CURLOPT_HTTPHEADER, slist);
33
34 curl_easy_perform(handle);
35
36 curl_slist_free_all(slist); /* free the list again */
37
39 curl_slist_append(3),
40
41
42
43libcurl 7.76.1 November 05, 2020 curl_slist_free_all(3)