/* curl_slist_append() appends a string to the linked list. It always returns the address of the first record, so that you can use this function as an initialization function as well as an append function. If you find this bothersome, then simply create a separate _init function and call it appropriately from within the program.  */
struct curl_slist* curl_slist_append(struct curl_slist *list, const char *data)
/* curl_slist_append() appends a string to the linked list. It always returns the address of the first record, so that you can use this function as an initialization function as well as an append function. If you find this bothersome, then simply create a separate _init function and call it appropriately from within the program.  */
struct curl_slist* curl_slist_append(struct curl_slist *list, const char *data)
{
  char *dupdata = strdup(data);
  if(!dupdata)
    return NULL;
  list = Curl_slist_append_nodup(list, dupdata);
  if(!list)
    free(dupdata);
  return list;
}