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 CURL *handle;
22 struct curl_slist *slist=NULL;
23
24 slist = curl_slist_append(slist, "X-libcurl: coolness");
25
26 if (slist == NULL)
27 return -1;
28
29 curl_easy_setopt(handle, CURLOPT_HTTPHEADER, slist);
30
31 curl_easy_perform(handle);
32
33 curl_slist_free_all(slist); /* free the list again */
34
36 Always
37
39 Nothing.
40
42 curl_slist_append(3),
43
44
45
46libcurl 7.82.0 November 26, 2021 curl_slist_free_all(3)