]> granicus.if.org Git - curl/commitdiff
docs: mention NULL is fine input to several functions
authorDaniel Stenberg <daniel@haxx.se>
Thu, 9 Aug 2018 14:37:39 +0000 (16:37 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 9 Aug 2018 22:24:12 +0000 (00:24 +0200)
Fixes #2837
Closes #2858
Reported-by: Markus Elfring
docs/libcurl/curl_easy_cleanup.3
docs/libcurl/curl_formfree.3
docs/libcurl/curl_free.3
docs/libcurl/curl_mime_free.3
docs/libcurl/curl_multi_cleanup.3
docs/libcurl/curl_share_cleanup.3
docs/libcurl/curl_slist_free_all.3

index a6969a02650380d254196e7dc6b792a314e7e458..626d98c5175cba550aafbef1ea72537c7bc86850 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2018, 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
@@ -47,6 +47,9 @@ Any use of the \fBhandle\fP after this function has been called and have
 returned, is illegal. \fIcurl_easy_cleanup(3)\fP kills the handle and all
 memory associated with it!
 
+Passing in a NULL pointer in \fIhandle\fP will make this function return
+immediately with no action.
+.SH "OLD TIMES"
 For libcurl versions before 7.17,: after you've called this function, you can
 safely remove all the strings you've previously told libcurl to use, as it
 won't use them anymore now.
index dd00494beef2f7792beaf548b91fc063140bdc95..6e0e95f574a5cd425ce5b8335e50d620671bb81c 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2018, 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
@@ -40,6 +40,9 @@ the \fIcurl_formadd(3)\fP invoke(s).
 
 \fBform\fP is the pointer as returned from a previous call to
 \fIcurl_formadd(3)\fP and may be NULL.
+
+Passing in a NULL pointer in \fIform\fP will make this function return
+immediately with no action.
 .SH AVAILABILITY
 Deprecated in 7.56.0.
 .SH RETURN VALUE
index 5bbf74535f0c6a9d05eba22e50e84b9e7f062c60..e2cf890f00b7a3c5cd1a940beb2fd68c5ac015ea 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2018, 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
@@ -31,5 +31,8 @@ curl_free - reclaim memory that has been obtained through a libcurl call
 curl_free reclaims memory that has been obtained through a libcurl call.  Use
 \fIcurl_free(3)\fP instead of free() to avoid anomalies that can result from
 differences in memory management between your application and libcurl.
+
+Passing in a NULL pointer in \fIptr\fP will make this function return
+immediately with no action.
 .SH "SEE ALSO"
 .BR curl_easy_unescape "(3), " curl_easy_escape "(3) "
index 9394b5748b63606877927cabc3dd64d7b51e5e26..80a95486ef543ea4062f634394f254947118850c 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2018, 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
@@ -40,6 +40,8 @@ not be explicitly freed as they are by the top structure freeing.
 \fBmime\fP is the handle as returned from a previous call to
 \fIcurl_mime_init(3)\fP and may be NULL.
 
+Passing in a NULL pointer in \fImime\fP will make this function return
+immediately with no action.
 .SH AVAILABILITY
 As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0.
 .SH RETURN VALUE
index 07d921605460987828413537677367c61f3da500..a945fd698fe148b2824a746b77c1755f5e33b52c 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2018, 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
@@ -40,6 +40,9 @@ handle is no longer connected to the multi handle
 
 3 - \fIcurl_multi_cleanup(3)\fP should be called when all easy handles are
 removed
+
+Passing in a NULL pointer in \fImulti_handle\fP will make this function return
+CURLM_BAD_HANDLE immediately with no other action.
 .SH RETURN VALUE
 CURLMcode type, general libcurl multi interface error code. On success,
 CURLM_OK is returned.
index 0b265e86e835067feb983ace848ce1aa6b7cf912..d74ef91d29b59f3f014f81e002377f2b76c5ea4c 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2018, 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
@@ -31,6 +31,8 @@ curl_share_cleanup - Clean up a shared object
 This function deletes a shared object. The share handle cannot be used anymore
 when this function has been called.
 
+Passing in a NULL pointer in \fIshare_handle\fP will make this function return
+immediately with no action.
 .SH RETURN VALUE
 CURLSHE_OK (zero) means that the option was set properly, non-zero means an
 error occurred as \fI<curl/curl.h>\fP defines. See the \fIlibcurl-errors.3\fP
index 895524914e44e19c68234f32fbade76c3a911243..82cb80ff22daa1280c7f1b15f4338282f64f31ff 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2018, 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
@@ -30,6 +30,9 @@ curl_slist_free_all - free an entire curl_slist list
 .SH DESCRIPTION
 curl_slist_free_all() removes all traces of a previously built curl_slist
 linked list.
+
+Passing in a NULL pointer in \fIlist\fP will make this function return
+immediately with no action.
 .SH RETURN VALUE
 Nothing.
 .SH EXAMPLE