curl_mime_free.3 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. .\" generated by cd2nroff 0.1 from curl_mime_free.md
  2. .TH curl_mime_free 3 "2025-01-17" libcurl
  3. .SH NAME
  4. curl_mime_free \- free a previously built mime structure
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. void curl_mime_free(curl_mime *mime);
  9. .fi
  10. .SH DESCRIPTION
  11. \fIcurl_mime_free(3)\fP is used to clean up data previously built/appended
  12. with \fIcurl_mime_addpart(3)\fP and other mime\-handling functions. This must
  13. be called when the data has been used, which typically means after
  14. \fIcurl_easy_perform(3)\fP has been called.
  15. The handle to free is the one you passed to the \fICURLOPT_MIMEPOST(3)\fP
  16. option: attached sub part mime structures must not be explicitly freed as they
  17. are by the top structure freeing.
  18. \fBmime\fP is the handle as returned from a previous call to
  19. \fIcurl_mime_init(3)\fP and may be NULL.
  20. Passing in a NULL pointer in \fImime\fP makes this function return immediately
  21. with no action.
  22. .SH PROTOCOLS
  23. This functionality affects http, imap and smtp
  24. .SH EXAMPLE
  25. .nf
  26. int main(void)
  27. {
  28. CURL *curl = curl_easy_init();
  29. if(curl) {
  30. /* Build the mime message. */
  31. curl_mime *mime = curl_mime_init(curl);
  32. /* send off the transfer */
  33. /* Free multipart message. */
  34. curl_mime_free(mime);
  35. }
  36. }
  37. .fi
  38. .SH AVAILABILITY
  39. Added in curl 7.56.0
  40. .SH RETURN VALUE
  41. None
  42. .SH SEE ALSO
  43. .BR curl_free (3),
  44. .BR curl_mime_init (3)