From 6fac5a3e65217f1686927ecc8eda567888b29d4f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 9 Aug 2018 16:37:39 +0200 Subject: [PATCH] docs: mention NULL is fine input to several functions Fixes #2837 Closes #2858 Reported-by: Markus Elfring --- docs/libcurl/curl_easy_cleanup.3 | 5 ++++- docs/libcurl/curl_formfree.3 | 5 ++++- docs/libcurl/curl_free.3 | 5 ++++- docs/libcurl/curl_mime_free.3 | 4 +++- docs/libcurl/curl_multi_cleanup.3 | 5 ++++- docs/libcurl/curl_share_cleanup.3 | 4 +++- docs/libcurl/curl_slist_free_all.3 | 5 ++++- 7 files changed, 26 insertions(+), 7 deletions(-) diff --git a/docs/libcurl/curl_easy_cleanup.3 b/docs/libcurl/curl_easy_cleanup.3 index a6969a026..626d98c51 100644 --- a/docs/libcurl/curl_easy_cleanup.3 +++ b/docs/libcurl/curl_easy_cleanup.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , 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. diff --git a/docs/libcurl/curl_formfree.3 b/docs/libcurl/curl_formfree.3 index dd00494be..6e0e95f57 100644 --- a/docs/libcurl/curl_formfree.3 +++ b/docs/libcurl/curl_formfree.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , 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 diff --git a/docs/libcurl/curl_free.3 b/docs/libcurl/curl_free.3 index 5bbf74535..e2cf890f0 100644 --- a/docs/libcurl/curl_free.3 +++ b/docs/libcurl/curl_free.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , 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) " diff --git a/docs/libcurl/curl_mime_free.3 b/docs/libcurl/curl_mime_free.3 index 9394b5748..80a95486e 100644 --- a/docs/libcurl/curl_mime_free.3 +++ b/docs/libcurl/curl_mime_free.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , 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 diff --git a/docs/libcurl/curl_multi_cleanup.3 b/docs/libcurl/curl_multi_cleanup.3 index 07d921605..a945fd698 100644 --- a/docs/libcurl/curl_multi_cleanup.3 +++ b/docs/libcurl/curl_multi_cleanup.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , 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. diff --git a/docs/libcurl/curl_share_cleanup.3 b/docs/libcurl/curl_share_cleanup.3 index 0b265e86e..d74ef91d2 100644 --- a/docs/libcurl/curl_share_cleanup.3 +++ b/docs/libcurl/curl_share_cleanup.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , 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\fP defines. See the \fIlibcurl-errors.3\fP diff --git a/docs/libcurl/curl_slist_free_all.3 b/docs/libcurl/curl_slist_free_all.3 index 895524914..82cb80ff2 100644 --- a/docs/libcurl/curl_slist_free_all.3 +++ b/docs/libcurl/curl_slist_free_all.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , 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