Re: [xslt] Do not free the hash keys during xmlHashScanFull



On Tue, Sep 23, 2003 at 02:34:36PM +0200, Karl Eichwalder wrote:
> Daniel Veillard <veillard@redhat.com> writes:
> 
> >   Hum, works for me on Red Hat 9 + updates , yelp 2.2 and the Severn beta
> > with yelp 2.4, on i386. Is the bug x86-64 specific ?
> 
> Yes, as said previously.

Then I really don't understand why this doesn't fail on other architecture.
Either the free is done too early or twice and the patch is valid, but
why the same code is working on i386, or the free are not the problem and
there is a latent isolated bug somewhere and we're just fixing the 
symptom. The comment
  "The keys will be freed by xmlHashFree right afterwards anyway."
is unclear, the routine does not call xmlHashFree(), the function
xsltFreeExtData() just does a free of the structure stored as extension
data, and if it not freed at that point, I don't see how libxslt can
get a pointer to it and not leak.

  Sorry, 1/ this is very confusing 2/ this seems to try to fix the
symptoms not the source of the problem 3/ this is arch specific while
such a problem should not really 4/ this introduce a potential memory
leak 5/ I still can't reproduce the problem (I have no x86-64 desktop
to test myself)

  The best would be for the programmer who suggested this patch to 
explain clearly where he expect the block of memory kept in the hash
table to be actually freed.

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]