After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 165349 - Memory leak when using python validation error handlers
Memory leak when using python validation error handlers
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-01-26 21:34 UTC by Brent Hendricks
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test-case to show memory leak (718 bytes, text/plain)
2005-01-26 21:39 UTC, Brent Hendricks
  Details
Patch to fix leak (2.13 KB, patch)
2005-01-26 21:47 UTC, Brent Hendricks
committed Details | Review
Schema handlers leak patch (1.46 KB, patch)
2005-03-30 01:41 UTC, Brent Hendricks
committed Details | Review

Description Brent Hendricks 2005-01-26 21:34:49 UTC
Please describe the problem:
The python bindings have a small memory leak id you register error handlers with
setValidityErrorHandler().  The problem is that the xmlValidCtxtPyCtxt structure
does not get freed in the (autogenerated) libxml_xmlFreeValidCtxt.

I believe the correct fix is to write a libxml_xmlFreeValidCtxt that frees that
structure.  I'll attach a testcase and patch.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Brent Hendricks 2005-01-26 21:39:45 UTC
Created attachment 36568 [details]
Test-case to show memory leak
Comment 2 Brent Hendricks 2005-01-26 21:47:34 UTC
Created attachment 36569 [details] [review]
Patch to fix leak
Comment 3 Brent Hendricks 2005-01-26 22:03:39 UTC
Hmm.  Schemas seem to have the same problem....
Comment 4 Daniel Veillard 2005-03-02 10:49:39 UTC
Okay reproduced, I applied your patch and it fixed it, thanks !
Could you also submidt a patch for the case of schemas ? 

  sorry it took so long, I lost track of it,

  thanks !

Daniel
Comment 5 Brent Hendricks 2005-03-30 01:41:14 UTC
Created attachment 39414 [details] [review]
Schema handlers leak patch

Patch to fix memory leak when freeing schema error handlers
Comment 6 Brent Hendricks 2005-03-30 01:44:43 UTC
Reopening to submit the patch for the schema case.  Interesting enough, the code
was already there, but #if'd out.  I have another schema error handler patch for
python, but I'll put that in a separate bug.
Comment 7 Daniel Veillard 2005-03-30 07:40:52 UTC
Okay, applied ! I just made the function static, this is now commited
in CVS,

 thanks a lot,

Daniel
Comment 8 Daniel Veillard 2005-09-05 08:59:44 UTC
This should be closed by release of libxml2-2.6.21,

  thanks,

Daniel