Re: [xml] additional xmlFree needed in htmlSAXParseDoc?



On Wed, Aug 13, 2003 at 02:08:03PM +0200, kidman breaken de wrote:

Hello!

I was stepping through and the code and were wondering about a little
thig.
In the function "htmlSAXParseDoc" in HTMLparser.c in line 5326 "sax" is
assigned to "ctxt->sax". Should the old sax be free'd before the new one
is assigned?

So the code would would look like this:

    if (sax != NULL) {
        if (ctxt->sax) xmlFree (ctxt->sax); 
        ctxt->sax = sax;
        ctxt->userData = userData;
    }

  Seems right because it is allocated in the function htmlInitParserCtxt()

    Applied, thanks !

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]