curl_free.3 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .TH curl_free 3 "12 Aug 2003" "libcurl 7.10" "libcurl Manual"
  25. .SH NAME
  26. curl_free - reclaim memory that has been obtained through a libcurl call
  27. .SH SYNOPSIS
  28. .nf
  29. #include <curl/curl.h>
  30. void curl_free(char *ptr);
  31. .fi
  32. .SH DESCRIPTION
  33. curl_free reclaims memory that has been obtained through a libcurl call. Use
  34. \fIcurl_free(3)\fP instead of free() to avoid anomalies that can result from
  35. differences in memory management between your application and libcurl.
  36. Passing in a NULL pointer in \fIptr\fP will make this function return
  37. immediately with no action.
  38. .SH EXAMPLE
  39. .nf
  40. char *width = curl_getenv("COLUMNS");
  41. if(width) {
  42. /* it was set! */
  43. curl_free(width);
  44. }
  45. .fi
  46. .SH AVAILABILITY
  47. Always
  48. .SH RETURN VALUE
  49. None
  50. .SH "SEE ALSO"
  51. .BR curl_easy_unescape "(3), " curl_easy_escape "(3) "