aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-08-05 14:28:21 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-08-05 14:28:39 +0200
commit9947f259bf2e75adad79d72bb22e7b60821d7001 (patch)
treea8fa9c8ebce2a9c64e4262db76b87dffdd28b4b6
parent33de75ed6334cd6d225cf9f399c07d710d6349e6 (diff)
curl_slist_append.3: add error checking to the example
-rw-r--r--docs/libcurl/curl_slist_append.36
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/libcurl/curl_slist_append.3 b/docs/libcurl/curl_slist_append.3
index 529560e8a..1a0a65796 100644
--- a/docs/libcurl/curl_slist_append.3
+++ b/docs/libcurl/curl_slist_append.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
@@ -46,6 +46,10 @@ pointer is returned.
struct curl_slist *slist=NULL;
slist = curl_slist_append(slist, "pragma:");
+
+ if (slist == NULL)
+ return -1;
+
curl_easy_setopt(handle, CURLOPT_HTTPHEADER, slist);
curl_easy_perform(handle);