cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Safe free of IDNA memory

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 10 May 2004 16:39:56 +0200 (CEST)

On Mon, 10 May 2004, Gisle Vanem wrote:

> Simon, how about a new idna_free() function?

Here's my suggestion. No frills:

--- idna.c~ Mon Mar 8 17:18:49 2004
+++ idna.c Mon May 10 16:38:35 2004
@@ -503,6 +503,21 @@
 }

 /**
+ * idna_free:
+ * @input: a pointer to a memory area that was previously allocated by libidn
+ *
+ * By providing this function, applications can make sure that the memory
+ * allocated by the library is freed by the same memory subsystem that was
+ * used to allocate it.
+ *
+ * Return value: none.
+ **/
+void idna_free (void *ptr)
+{
+ free (ptr);
+}
+
+/**
  * idna_to_ascii_8z:
  * @input: zero terminated input UTF-8 string.
  * @output: pointer to newly allocated output string.

-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-05-10