[xml] Re: update of the XML CVS code

Date view Thread view Subject view Author view

From: Miguel de Icaza (miguel@gnu.org)
Date: Mon Jun 21 1999 - 23:31:03 EDT


> I just commited a bunch of changes. At least one breaks the libxml.so.0.0.0
> binary interface, more precisely xmlEncodeEntities() is now reentrant, but
> the result string has to freed now. Problem is that freeing the result of
> the previous implementation results in a SIGSEGV :-\

Daniel, this change is pretty bad, because it means that both released
Gnumeric and released GnoRPM will memory leak with the the new
libraries and they will crash if used with the new libraries.

Could you please consider making a new release of the XML libraries
reverting this change?

I suggest a binary compatible change like this:

  1. Revert the patch.
  2. Make the prototype for xmlEncodeEntities be:

     const CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);

     The "const" can be used to tell the user "I am returning
     something that I own, do not dare free()ing it", which is a
     convention we use on the gnome-libs.

  3. Provide a *new* function entry point:

     CHAR *xmlEncodeEntities_r (xmlDocPtr doc, const CHAR *input);

     Which can just be:

     CHAR *xmlEncodeEntities_r (xmlDocPtr doc, const CHAR *input)
     {
         return g_strdup (xmlEncodeEntities (doc, input));
     }

That way we do not have to resort to terrible hacks in Gnumeric/GnoRPM
nor any other applications to handle the 2 different APIs.

Miguel.

----
Message from the list xml@rufus.w3.org
Archived at : http://rufus.w3.org/veillard/XML/messages
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rufus.w3.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:29:38 EDT