idn-free.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* idn-free.h --- Invoke the free function to release memory
  2. Copyright (C) 2004-2024 Simon Josefsson
  3. This file is part of GNU Libidn.
  4. GNU Libidn is free software: you can redistribute it and/or
  5. modify it under the terms of either:
  6. * the GNU Lesser General Public License as published by the Free
  7. Software Foundation; either version 3 of the License, or (at
  8. your option) any later version.
  9. or
  10. * the GNU General Public License as published by the Free
  11. Software Foundation; either version 2 of the License, or (at
  12. your option) any later version.
  13. or both in parallel, as here.
  14. GNU Libidn is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. General Public License for more details.
  18. You should have received copies of the GNU General Public License and
  19. the GNU Lesser General Public License along with this program. If
  20. not, see <https://www.gnu.org/licenses/>. */
  21. #include <config.h>
  22. /* Get specification. */
  23. #include "idn-free.h"
  24. /* Get free. */
  25. #include <stdlib.h>
  26. /**
  27. * idn_free:
  28. * @ptr: memory region to deallocate, or %NULL.
  29. *
  30. * Deallocates memory region by calling free(). If @ptr is %NULL no
  31. * operation is performed.
  32. *
  33. * Normally applications de-allocate strings allocated by libidn by
  34. * calling free() directly. Under Windows, different parts of the
  35. * same application may use different heap memory, and then it is
  36. * important to deallocate memory allocated within the same module
  37. * that allocated it. This function makes that possible.
  38. **/
  39. void
  40. idn_free (void *ptr)
  41. {
  42. free (ptr);
  43. }