curl_free.3 905 B

12345678910111213141516171819202122232425262728293031323334353637
  1. .\" generated by cd2nroff 0.1 from curl_free.md
  2. .TH curl_free 3 "2025-01-17" libcurl
  3. .SH NAME
  4. curl_free \- reclaim memory that has been obtained through a libcurl call
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. void curl_free(void *ptr);
  9. .fi
  10. .SH DESCRIPTION
  11. curl_free reclaims memory that has been obtained through a libcurl call. Use
  12. \fIcurl_free(3)\fP instead of free() to avoid anomalies that can result from
  13. differences in memory management between your application and libcurl.
  14. Passing in a NULL pointer in \fIptr\fP makes this function return immediately
  15. with no action.
  16. .SH PROTOCOLS
  17. This functionality affects all supported protocols
  18. .SH EXAMPLE
  19. .nf
  20. int main(void)
  21. {
  22. char *width = curl_getenv("COLUMNS");
  23. if(width) {
  24. /* it was set! */
  25. curl_free(width);
  26. }
  27. }
  28. .fi
  29. .SH AVAILABILITY
  30. Added in curl 7.1
  31. .SH RETURN VALUE
  32. None
  33. .SH SEE ALSO
  34. .BR curl_easy_escape (3),
  35. .BR curl_easy_unescape (3)